ModuleNotFound 错误但模块刚刚安装

ModuleNotFound error but module has just been installed

我正在使用 Windows 10,Python 3.6.4。我正在尝试使用模块 Pyperclip 并使用 pip 安装它:

c:\Users\Bertie>pip install pyperclip
Requirement already satisfired: pyperclip in c:\python36\lib\site-packages (1.8.0)

但是当我尝试运行一个使用这个模块的程序时,我得到这个错误:

c:\Users\Bertie\scraping.py test
Traceback (most recent call last):
File "C:\Users\Bertie\scraping.py", line 3, in <module>
    import webbrowser, sys, pyperclip
ModuleNotFoundError: No module named 'pyperclip'

我该如何解决这个问题?谢谢。

Where is the py file? Maybe try cd-ing into the folder and run python (python3) scraping.py? Also check that you have installed the correct interpreter and are using the correct version of python.

重新安装跟踪显示您已成功安装 python36 的软件包。 检查您的系统中是否有多个 python。在 windows cmd 控制台中键入“python”,然后检查 python 版本以查看 python36 是否为默认版本。然后显式使用python解释器启动脚本“python your_python_script.py”.

Maybe You Installed pyperclip in conda env or a virtualenv and you forgot to activate it ?

因为这在我身上发生过很多次。

Or Maybe You Have 2 Instances Of Python installed on your computer and you accidentally installed pyperclip in the other instance of python ?