在MacOSX上安装Python模块

时间:2018-06-21 13:39:07

标签: python-3.x http pip python-requests

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

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

我刚刚安装了setuptools,但是仍然无法正常工作。

编辑: 当我启动命令“ 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)

有人知道我的错吗?

1 个答案:

答案 0 :(得分:0)

http 2012年的0.02 was released版本。homepage返回错误404。

我认为包裹只是被遗弃,损坏和过时了。避免使用它或对其进行分叉并自行更新。