简体   繁体   中英

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. I guess the problem maybe has relation with PyPi index database. If someone know anything about that problem, welcome to tell me.

Python version:

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

Here is my ~/.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

(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+). 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).

To be sure, check this page on PyPI, you can see in the source the link of 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. 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 !

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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