本地有requests库,但是Pycharm提示no module named 'requests'

在import requests时标红,本地是有库的。找了n多办法没解决,最后发现是Pycharm的库没有更新问题

解决方法很简单:

1.确保自己本地安装了库,可以pip list查看

2.在Pycharm的File - Settings - Project Interpreter页面,点击Add,

本地有requests库,但是Pycharm提示no module named 'requests'

 

3.再点击System Interpreter,再重新选择一遍自己的环境变量即可

本地有requests库,但是Pycharm提示no module named 'requests'

4.点击OK后,Project Interpreter 页面会重新刷新pip已安装的库。现在在看Pycharm的import requests就不再标红了

本地有requests库,但是Pycharm提示no module named 'requests'