![](/img/trans.png)
[英]networkx installed but cannot import: No module named 'networkx'
[英]Cannot import an installed module
我无法导入已安装的模块
ModuleNotFoundError: No module named 'Google
它是在我运行时安装的
pip install Google
我得到:
Requirement already satisfied: soupsieve>1.2 in /Users/sebastianstros/Library/Caches/pypoetry/virtualenvs/mama-bots-9Qh4WGwv-py3.9/lib/python3.9/site-packages (from beautifulsoup4->Google) (2.3.2.post1)
但是导入我得到的模块:
Traceback (most recent call last):
File "/Users/sebastianstros/PycharmProjects/mama-bots/mama_bots/bots/calendar_bot/personal_calendar_bot.py", line 7, in <module>
from Google import Create_Service
ModuleNotFoundError: No module named 'Google'
即使这评估为 True:
print(sys.path[-1] == "/Users/sebastianstros/Library/Caches/pypoetry/virtualenvs/mama-bots-9Qh4WGwv-py3.9/lib/python3.9/site-packages")
这让我感到惊讶,因为 sys.path 是可以从中获取模块的路径列表,并且语句的右侧是模块的位置。
因为实际上没有名为Google
的包,您可以尝试使用pip install google
获取 Google 库。
您可以从PyPI 网站查看所有包。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.