在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'

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-21
  • 2021-06-05
  • 2022-01-01
  • 2021-04-14
  • 2021-07-29
  • 2022-12-23
猜你喜欢
  • 2021-04-18
  • 2021-12-13
  • 2021-10-27
  • 2021-10-23
  • 2021-12-15
  • 2021-12-29
相关资源
相似解决方案