[英]ModuleNotFoundError: No module named 'pyautogui'
我嘗試在 Visual Studio 中安裝 pyautogui,但每當我運行以下程序時:
import subprocess
import pyautogui #pylint: disable=E0401
import time
import pandas as pd #pylint: disable=E0401
from datetime import datetime
def sign_in(meetingid, pswd):
# Opens up zoom app
subprocess.call(r"C:\Users\krish\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Zoom")
sign_in('6931145146', 'SKS123')
我收到以下錯誤:
File "c:\Users\krish\Desktop\AUTOBOT\Zoom Auto Attender", line 2, in <module>
import pyautogui #pylint: disable=E0401
ModuleNotFoundError: No module named 'pyautogui'
但它不起作用,所以請幫助。
根據您的描述,請參考以下內容:
請在VS Code終端中使用“ python --version
”或“ pip --version
”命令檢查VS Code終端當前使用的python是否與VS Code終端左下角顯示的一致。
(如果不一致,請使用快捷鍵Ctrl+Shift+`打開一個新的VS Code終端,它會自動進入選擇的環境。)
檢查模塊的安裝。 ( pip show pyautogui
)
VS Code 識別 python 模塊的位置在當前使用的 python 環境的“ \Lib\site-packages\
”中。
跑:
參考: VS Code 中的 Python 環境。
r u sure that u r not in the venv(virtual environment), if this is not the case manually install the.whl files go to this site https://www.lfd.uci.edu/~gohlke/pythonlibs/
and download車輪文件。 然后在 cmd 或終端類型pip install 'where u have stored the.whl file
的位置
我發現我的機器上安裝了兩個 Python 的問題。 所以我將它們全部刪除並重新安裝,嗯,問題解決了。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.