[英]'ModuleNotFoundError' in python venv? I definitely have the module installed in the venv
[英]ModuleNotFoundError when importing installed module in venv
我在 Visual Studio Code 中使用venv
在虚拟环境中安装了一个库,然后将其导入到 Python 文件中。 但是,当我运行该文件时,我得到一个 ModuleNotFoundError。
尝试的步骤和检查:
venv\Lib\site-packages
中。奇事:
which python
in Bash returns /c/Users/Lyndon/Documents/VS Code/seatmap_parser/\Users\Lyndon\Documents\VS Code\seatmap_parser\venv/Scripts/python
when it should presumably return C:\Users\Lyndon\Documents\VS Code\seatmap_parser\venv\Scripts\python
。"python.pythonPath": "${workspaceRoot}/venv/Scripts/python"
添加到工作区settings.json
会引发此错误: The Python path in your debug configuration is invalid.
我随时准备应要求检查任何遗漏的细节。 为什么它不起作用?
如果你想得到 OUTPUT 只需在指定文件中单击run
,那么你必须对 go 用户设置。 在“python”键后的"code-runner.executorMap
”字典中输入您的 python 路径。 如果未指定,只需键入code-runner.executorMap
,它将为您生成该字典。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.