簡體   English   中英

無法導入已安裝的模塊

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM