运行.py的文件的时候,有时候会遇到这样的报错。不要慌,如果你掌握了面向百度编程的话,能够解决百分之90的bug,专治各种疑难杂症。
E:\python_pycharm\venv\Scripts\python.exe E:/python_pycharm/test.py Traceback (most recent call last): File "E:/python_pycharm/test.py", line 1, in <module> import requests ModuleNotFoundError: No module named 'requests' Process finished with exit code 1
原因:没有导入requests库
解决办法:
1:找到Python安装路径
进入到Scripts目录底下
C:\Users\lenovo\AppData\Local\Programs\Python\Python37\Scripts
2:安装模块requests
安装命令如下:
pip install requests
好的,终于在不断的坚持之下,成功安装模块requests