已经pip install requests,后面在pycharm里却无法import requests,
已经排除不是环境变量配置问题
在python console里面import requests,
Traceback (most recent call last):
File "", line 1, in
File "C:\Program Files\PyCharm\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
ModuleNotFoundError: No module named 'requests'
报上面这个错误。
后面百度到,可以在pycharm里面直接下载安装需要的库,不用每次在cmd里面区pip install ***
方法:
点击File->settings ->Project Interpreter ,点击右方的+号,在搜索栏搜索requests,点击安装,等待安装完毕即可。