【问题标题】:Installing Python modules on MacOSX在 MacOSX 上安装 Python 模块
【发布时间】:2018-06-21 13:39:06
【问题描述】:

我正在尝试通过命令“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)

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

【问题讨论】:

  • 请发布整个错误信息
  • @ForceBru 我编辑了我的问题,对你有帮助吗?

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


【解决方案1】:

http 2012 年版本 0.02 was releasedhomepage 返回错误 404。

我认为该软件包只是被遗弃、损坏和过时。避免使用它或 fork 并自行更新。

【讨论】:

  • 我想使用 httplib,但它的名称似乎已在 http.client for Python 3 中更改。无论如何它都不起作用。
  • 那个是http from the standard library,不用安装,Python自带的。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2013-10-02
  • 2011-01-23
  • 2021-01-03
  • 2013-11-05
  • 2011-07-28
  • 2020-10-05
  • 2020-09-13
相关资源
最近更新 更多