简体   繁体   English

使用 pip 安装和设置路径后,在 python 中出现导入错误

[英]Getting an import error in python after using pip install and setting path

Getting an import error in python after using pip install and setting path in vscode在 vscode 中使用 pip 安装和设置路径后,在 python 中出现导入错误

 File "c:\Users\auxyc\Desktop\keylog\keylogger.py", line 1, in <module>
    import keyboard
ModuleNotFoundError: No module named 'keyboard'

I have set the path in the settings, and python is in path我已经在设置中设置了路径,并且 python 在路径中

EDIT: I have tried to install it via the vscode terminal编辑:我试图通过 vscode 终端安装它

Once check if Python 3.7 selected as your interpreter in Visual Studio Code.检查 Python 3.7 是否被选为 Visual Studio Code 中的解释器。 Try to change it to Python 3.8, then execute once.尝试将其更改为Python 3.8,然后执行一次。 If still errors exists please let me know如果仍然存在错误,请告诉我

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

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