下载Requests安装包

下载地址:https://github.com/kennethreitz/requests

解决eclipse Pydev中import时报错Unresolved import requests的方法

 

点击Download ZIP按钮进行下载。

 

解决eclipse Pydev中import时报错Unresolved import requests的方法

 

下载成功后,将解压文件拷贝到python的安装目录下。

解决eclipse Pydev中import时报错Unresolved import requests的方法

 

在CMD命令窗口中进入到Requests-master目录下,输入python setup.py install命令进行安装requests包。

解决eclipse Pydev中import时报错Unresolved import requests的方法

 

打开eclipse后,点击Window->Preferences->PyDev->Interpreters->Python Interpreter选项,最后点击QuickAuto-Config按钮,加载lib,然后点击Apply按钮,最后点击OK按钮。

解决eclipse Pydev中import时报错Unresolved import requests的方法

 

 

在Eclipse中创建项目后,输入import requests语句后,再也不出现错误。

import requests

 

rs =requests.get('http://www.baidu.com')

print rs.status_code

运行代码成功并打印出http的响应状态。


 

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Chris_111X/article/details/52312523

相关文章:

  • 2022-12-23
  • 2021-09-07
  • 2022-12-23
  • 2022-01-04
  • 2021-12-25
  • 2022-12-23
  • 2022-01-07
  • 2022-12-23
猜你喜欢
  • 2021-09-25
  • 2021-07-11
  • 2021-10-01
  • 2021-09-23
  • 2021-12-27
相关资源
相似解决方案