简体   繁体   English

使用pip从PyPi镜像安装IPython

[英]Install IPython from PyPi mirrors with pip

I want to accelerate downloading Python packages with PyPi mirrors(our company mirror), but the pip can't select correct iPython version from mirrors. 我想加快使用PyPi镜像(我们公司的镜像)下载Python软件包的速度,但是pip无法从镜像中选择正确的iPython版本。 I guess the problem maybe has relation with PyPi index database. 我想这个问题可能与PyPi索引数据库有关。 If someone know anything about that problem, welcome to tell me. 如果有人对这个问题有任何了解,欢迎告诉我。

Python version: Python版本:

(p2) ➜  /tmp python --version
Python 2.7.13

Here is my ~/.pip/pip.conf 这是我的〜/ .pip / pip.conf

[global]
index-url = http://mirrors.company.com/pypi/simple/
trusted-host=mirrors.company.com

The following error message was print when I used pip install ipython 当我使用pip install ipython时,显示以下错误消息

(p2) ➜  /tmp pip install ipython
Collecting ipython
  Downloading http://mirrors.aliyun.com/pypi/packages/79/63/b671fc2bf0051739e87a7478a207bbeb45cfae3c328d38ccdd063d9e0074/ipython-6.1.0.tar.gz (5.1MB)
    100% |████████████████████████████████| 5.1MB 7.6MB/s
    Complete output from command python setup.py egg_info:

    IPython 6.0+ does not support Python 2.6, 2.7, 3.0, 3.1, or 3.2.
    When using Python 2.7, please install IPython 5.x LTS Long Term Support version.
    Beginning with IPython 6.0, Python 3.3 and above is required.

    See IPython `README.rst` file for more information:

        https://github.com/ipython/ipython/blob/master/README.rst

    Python sys.version_info(major=2, minor=7, micro=13, releaselevel='final', serial=0) detected.



    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/6c/gbrkbbzd4gvdp56x7x8s6xpw0000gn/T/pip-build-FVITyR/ipython/ 

Your Proxy/Mirror does not implement pep503 correctly and your pip may be is out of date (you need pip 9.0.1+). 您的代理服务器/镜像未正确实现pep503 ,并且您的点数可能已过期(您需要的点数为9.0.1+)。 Since December 2016 PyPI has been fixed to correctly expose extra metadata telling Pip with which Python version a package is compatible ( My talk at PyCon , and PyBay this year about this). 201612月以来,PyPI已修复,可以正确暴露额外的元数据,以告诉Pip程序包与哪个Python版本兼容( 我在PyCon和今年的PyBay上的演讲 )。

To be sure, check this page on PyPI, you can see in the source the link of IPython 6.0.0: 可以肯定的是,请在PyPI上检查此页面,您可以在源代码中看到IPython 6.0.0的链接:

<a data-requires-python="&gt;=3.3" href="../../packages/.../ipython-6.0.0.tar.gz" >ipython-6.0.0.tar.gz</a><br/>

Now check the same page on your mirror ... it is missing the data-requires-python="&gt;=3.3" field, so pip cannot know IPython 6.0 is incompatible. 现在,检查镜像中同一页 ...缺少data-requires-python="&gt;=3.3"字段,因此pip无法知道IPython 6.0不兼容。 I would suggest to contact the people running the mirror to update it. 我建议联系运行镜像的人员进行更新。

Also please setup your mirror to only allow https, or you will be unsure that what you are downloading has not been tampered with ! 另外,请将您的镜像设置为仅允许https,否则您将不确定所下载的内容是否已被篡改!

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

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