简体   繁体   English

ModuleNotFoundError:没有名为“pyautogui”的模块

[英]ModuleNotFoundError: No module named 'pyautogui'

I tried installing pyautogui in Visual Studio but whenever I run the following program:我尝试在 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')

I get the following error:我收到以下错误:

File "c:\Users\krish\Desktop\AUTOBOT\Zoom Auto Attender", line 2, in <module>
    import pyautogui #pylint: disable=E0401
ModuleNotFoundError: No module named 'pyautogui'

I tried the available solution import error for pyautogui我尝试了pyautogui 的可用解决方案导入错误

But it doesn't work, So please help.但它不起作用,所以请帮助。

According to your description, please refer to the following:根据您的描述,请参考以下内容:

  1. Please use the command " python --version " or " pip --version " in the VS Code terminal to check whether the python currently used by the VS Code terminal is consistent with the one displayed in the lower left corner of the VS Code.请在VS Code终端中使用“ python --version ”或“ pip --version ”命令检查VS Code终端当前使用的python是否与VS Code终端左下角显示的一致。

    在此处输入图像描述

    (If they are inconsistent, please use the shortcut key Ctrl+Shift+` to open a new VS Code terminal, it will automatically enter the selected environment.) (如果不一致,请使用快捷键Ctrl+Shift+`打开一个新的VS Code终端,它会自动进入选择的环境。)

  2. Check the installation of the module.检查模块的安装。 ( pip show pyautogui ) pip show pyautogui

    在此处输入图像描述

    The location where VS Code recognizes the python module is in " \Lib\site-packages\ " of the currently used python environment. VS Code 识别 python 模块的位置在当前使用的 python 环境的“ \Lib\site-packages\ ”中。

Run:跑:

在此处输入图像描述

Reference: Python environments in VS Code .参考: VS Code 中的 Python 环境

You probably need to install the package for pyautogui您可能需要为 pyautogui 安装 package

https://pyautogui.readthedocs.io/en/latest/ https://pyautogui.readthedocs.io/en/latest/

pip install pyautogui

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 the wheel files. 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车轮文件。 and then in the cmd or terminal type pip install 'where u have stored the.whl file that should do the work然后在 cmd 或终端类型pip install 'where u have stored the.whl file的位置

I found a problem that I have two Python install on my machine.我发现我的机器上安装了两个 Python 的问题。 So I remove all of them and reinstall, um and the problem solve.所以我将它们全部删除并重新安装,嗯,问题解决了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM