vscode导入pycharm项目时报 ModuleNotFoundError: No module named X错误

原创
2022/10/25 18:36
阅读数 49

解决办法

在lanunch.json中配置env

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Current File",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal",
            "cwd": "${workspaceFolder}",
            "env": {"PYTHONPATH": "${cwd}"}
        }
    ]
}

 

在workspace的settings.json中配置

{
    "terminal.integrated.env.osx": {
        "PYTHONPATH": "${workspaceFolder}"
    },
}

 

展开阅读全文
加载中
点击引领话题📣 发布并加入讨论🔥
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部