[英]"ModuleNotFoundError: No module named '…' even though module is installed
Trying to import "libgen_api" module but get "Module not found"
error.尝试导入“libgen_api”模块但得到
"Module not found"
错误。
Pip install libgen-api
shows "requirement already satisfied"
and the module exists in the python folder as well. Pip install libgen-api
显示"requirement already satisfied"
并且该模块也存在于 python 文件夹中。
The documentation of the module says that it has to be called with libgen_api
.该模块的文档说它必须用
libgen_api
。
Other modules work fine.其他模块工作正常。 I am using VScode but the problem persists in the python terminal as well.
我正在使用 VScode,但问题仍然存在于 python 终端中。 I apologize if this question is redundant but so far I have not been able to find a solution anywhere.
如果这个问题是多余的,我深表歉意,但到目前为止,我无法在任何地方找到解决方案。
The problem was that VScode sys.path
showed python38-32
but the module was installed in python39
.问题是 VScode
sys.path
显示python38-32
但模块安装在python39
中。 To fix the issue go to View -> Command pallete -> select interpreter
and make sure to use the version under which pip installed the module.要将问题 go 修复到
View -> Command pallete -> select interpreter
,并确保使用 pip 安装模块的版本。
This answered my question.这回答了我的问题。 How can I change python version in Visual Studio Code?
如何在 Visual Studio Code 中更改 python 版本?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.