VS code gopls requires a module at the root of your workspace

解决方法

settings.json设置里面添加如下:

    "gopls": {
        "experimentalWorkspaceModule": true
    }
然后重新启动 vscode,可以发现package的引用报错就正常了

参考 https://www.jianshu.com/p/fde21b198795

Calling `poetry.core.masonry.api.get_requires_for_build_editable()` DEBUG No workspace root found, using project root DEBUG Calling `poetry.core.masonry.api.prepare_metadata_for_build_editable()` DEBUG Traceback (most recent call last): DEBUG File "<string>", line 14, in <module> DEBUG File "C:\Users\g30036847\AppData\Local\uv\cache\builds-v0\.tmp1pLFqS\Lib\site-packages\poetry\core\masonry\api.py", line 43, in prepare_metadata_for_build_wheel DEBUG builder = WheelBuilder(poetry, config_settings=config_settings) DEBUG ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ DEBUG File "C:\Users\g30036847\AppData\Local\uv\cache\builds-v0\.tmp1pLFqS\Lib\site-packages\poetry\core\masonry\builders\wheel.py", line 67, in __init__ DEBUG super().__init__(poetry, executable=executable, config_settings=config_settings) DEBUG File "C:\Users\g30036847\AppData\Local\uv\cache\builds-v0\.tmp1pLFqS\Lib\site-packages\poetry\core\masonry\builders\builder.py", line 40, in __init__ DEBUG raise RuntimeError( DEBUG RuntimeError: Building a package is not possible in non-package mode. DEBUG Released lock at `C:\Users\g30036847\AppData\Local\uv\cache\sdists-v9\editable\30f9bc5ef56419f1\.lock` DEBUG Released lock at `D:\projects\AI\dify-huawei\api\.venv\.lock` error: Failed to generate package metadata for `dify-api @ editable+.` Caused by: The build backend returned an error Caused by: Call to `poetry.core.masonry.api.prepare_metadata_for_build_editable` failed (exit code: 1) [stderr] Traceback (most recent call last): File "<string>", line 14, in <module> File "C:\Users\g30036847\AppData\Local\uv\cache\builds-v0\.tmp1pLFqS\Lib\site-packages\poetry\core\masonry\api.py", line 43, in prepare_metadata_for_build_wheel builder = WheelBuilder(poetry, config_settings=config_settings) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\g30036847\AppData\Local\uv\cache\builds-v0\.tmp1pLFqS\Lib\site-packages\poetry\core\masonry\builders\wheel.py", line 67, in __init__ super().__init__(poetry, executable=executable, config_settings=config_settings) File "C:\Users\g30036847\AppData\Local\uv\cache\builds-v0\.tmp1pLFqS\Lib\site-packages\poetry\core\masonry\builders\builder.py", line 40, in __init__ raise RuntimeError( RuntimeError: Building a package is not possible in non-package mode. hint: This usually indicates a problem with the package or the build environment.
最新发布
07-11
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值