Python ModuleNotFoundError:没有名为';pyautogui'-&燃气轮机;在所有IDE中,无论我尝试什么

Python ModuleNotFoundError:没有名为';pyautogui'-&燃气轮机;在所有IDE中,无论我尝试什么,python,python-3.x,pip,Python,Python 3.x,Pip,几个小时以来,我一直在网上寻找解决方案,但都无济于事 我有一段代码: #load packages import pyautogui #these are for our clicks and keystrokes! import time #required to call any time commands (i.e delay) #STEP ONE --> Get Cursor Location time.sleep(2) prin t(pyautogui.

几个小时以来,我一直在网上寻找解决方案,但都无济于事

我有一段代码:

#load packages
import pyautogui    #these are for our clicks and keystrokes!
import time         #required to call any time commands (i.e delay)

#STEP ONE --> Get Cursor Location
time.sleep(2)
prin

t(pyautogui.position())
/usr/bin/python3.9 "/home/silo/Documents/Python Projects/macro 1.py"
Traceback (most recent call last):
  File "/home/silo/Documents/Python Projects/macro 1.py", line 2, in <module>
    import pyautogui    #these are for our clicks and keystrokes!
ModuleNotFoundError: No module named 'pyautogui'

Process finished with exit code 1
但每次尝试运行此脚本时,都会出现以下错误:

#load packages
import pyautogui    #these are for our clicks and keystrokes!
import time         #required to call any time commands (i.e delay)

#STEP ONE --> Get Cursor Location
time.sleep(2)
prin

t(pyautogui.position())
/usr/bin/python3.9 "/home/silo/Documents/Python Projects/macro 1.py"
Traceback (most recent call last):
  File "/home/silo/Documents/Python Projects/macro 1.py", line 2, in <module>
    import pyautogui    #these are for our clicks and keystrokes!
ModuleNotFoundError: No module named 'pyautogui'

Process finished with exit code 1
/usr/bin/python3.9”/home/silo/Documents/Python Projects/macro 1.py“
回溯(最近一次呼叫最后一次):
文件“/home/silo/Documents/Python Projects/macro 1.py”,第2行,在
导入pyautogui#这些用于我们的点击和按键!
ModuleNotFoundError:没有名为“pyautogui”的模块
进程已完成,退出代码为1
这是我尝试在设置中安装任何软件包时发生的情况:

我当前正在使用:

#load packages
import pyautogui    #these are for our clicks and keystrokes!
import time         #required to call any time commands (i.e delay)

#STEP ONE --> Get Cursor Location
time.sleep(2)
prin

t(pyautogui.position())
/usr/bin/python3.9 "/home/silo/Documents/Python Projects/macro 1.py"
Traceback (most recent call last):
  File "/home/silo/Documents/Python Projects/macro 1.py", line 2, in <module>
    import pyautogui    #these are for our clicks and keystrokes!
ModuleNotFoundError: No module named 'pyautogui'

Process finished with exit code 1
  • 基本操作系统5.1.7 Hera
  • Ubuntu 18.04.4 LTS
  • Python 3.9.5
  • Pip 9.0.1(我已经通过终端将Pip升级到最新版本,尽管我认为这仍然适用于Python 3.6)
  • 我尝试过(但没有成功):

    #load packages
    import pyautogui    #these are for our clicks and keystrokes!
    import time         #required to call any time commands (i.e delay)
    
    #STEP ONE --> Get Cursor Location
    time.sleep(2)
    prin
    
    t(pyautogui.position())
    
    /usr/bin/python3.9 "/home/silo/Documents/Python Projects/macro 1.py"
    Traceback (most recent call last):
      File "/home/silo/Documents/Python Projects/macro 1.py", line 2, in <module>
        import pyautogui    #these are for our clicks and keystrokes!
    ModuleNotFoundError: No module named 'pyautogui'
    
    Process finished with exit code 1
    
    • 安装pyautogui、pillow、plotly、matplotlib
    • 将pyCharm的Python解释器更改为/usr/bin/python3.9(奇怪的是,pyCharm将此路径命名为python3.6)
    • 删除了Python 2.7的所有实例
    • alias='Python 3.9'
    • export PATH=“$PATH:/PATH/to/dir”
    • 使用以下软件安装所有内容:
      $python3-m pip

    您是否尝试过使用用于安装依赖项的相同python解释器(命令行python 3)执行代码?您是否检查过IDE python解释器和终端解释器是否相同?是的,我尝试过这两种注释,但仍然没有运气,解释器确实相互代表