简体   繁体   English

无法将请求导入 Python:ImportError 没有名为 urllib3 的模块

[英]Can't Import Requests into Python: ImportError no module named urllib3

I've searched on this but other examples I've come across are people having issues installing Requests, my issue is around importing the module:我已经搜索过这个,但我遇到的其他例子是人们在安装 Requests 时遇到问题,我的问题是关于导入模块:

Using Putty (connected to a HDF 2.4 sandbox session) and Python to call an API.使用 Putty(连接到 HDF 2.4 沙箱会话)和 Python 来调用 API。

Last night, I had this working - installed the Requests module no problem, defined Python, and then made the GET request, worked perfect.昨晚,我有这个工作 - 安装请求模块没问题,定义 Python,然后发出 GET 请求,工作完美。

Tonight, I've followed the exact same steps, but when I try to 'Import Requests' I'm getting the error:今晚,我遵循了完全相同的步骤,但是当我尝试“导入请求”时出现错误:

ImportError: No module named urllib3

The steps I've replicated from last night are:我昨晚复制的步骤是:

[root@sandbox ~]# pip install requests  
python –v
import requests 

Figure I must have inadvertently changed something... Can anyone please advise?图我一定是无意中改变了一些东西......有人可以请教吗?

这可能不再可重现,因为引用的沙箱不应再可用,但一般来说,针对沙箱问题的推荐方法是从新的沙箱开始,这通常比故障排除更快。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM