在 MacOSX 上安装 Python 模块



我正在尝试通过命令"pip install http"安装http库。

它给了我这个错误: 命令"python setup.py egg_info"失败,错误代码为 1

我刚刚安装了安装工具,但它无论如何都不起作用。

编辑: 当我启动命令"pip3 install http' 时,我得到这个:

pip3 install http
Collecting http
Using cached https://files.pythonhosted.org/packages/e3/91/a9260805e532e33df273b8f7dffad5c51693f8f9ba5f86bedcf42a7f22eb/http-0.02.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/1v/xm2qv7l132sghltfqm3q15wm0000gn/T/pip-install-g44pke5e/http/setup.py", line 3, in <module>
import http
File "/private/var/folders/1v/xm2qv7l132sghltfqm3q15wm0000gn/T/pip-install-g44pke5e/http/http/__init__.py", line 17, in <module>
from request import Request
ImportError: cannot import name 'Request'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/1v/xm2qv7l132sghltfqm3q15wm0000gn/T/pip-install-g44pke5e/http/

我尝试了很多次检查和上传请求包,但是当我这样做时,我得到这个:

pip3 install requests
Requirement already satisfied: requests in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (2.19.1)
Requirement already satisfied: certifi>=2017.4.17 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from requests) (2018.4.16)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from requests) (3.0.4)
Requirement already satisfied: urllib3<1.24,>=1.21.1 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from requests) (1.23)
Requirement already satisfied: idna<2.8,>=2.5 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from requests) (2.7)

有人知道我做错了什么吗?

http0.02版本于2012年发布。主页返回错误 404。

我认为这个包装只是被遗弃、破碎和过时了。避免它或分叉它并自己更新它。

最新更新