Repository navigation
Closed
Labels
Description
Context: IPython just released 6.0rc1 on to PyPI, which is only compatible with 3.3+. pip install ipython on python 2.7 pulls down IPython 5.3.0 as you'd expect when invoked as pip install ipython. However, setuptools instead pulls down IPython 6.0 leading to an installation error.
Minimally reproducible example:
# setup.py
from setuptools import setup
setup(
name='example',
install_requires=['ipython'],
)Outputs:
(env) $ python -c 'import pkg_resources; print pkg_resources.get_distribution("setuptools")'
setuptools 34.4.1
(env) $ python setup.py develop
running develop
running egg_info
writing requirements to example.egg-info/requires.txt
writing example.egg-info/PKG-INFO
writing top-level names to example.egg-info/top_level.txt
writing dependency_links to example.egg-info/dependency_links.txt
reading manifest file 'example.egg-info/SOURCES.txt'
writing manifest file 'example.egg-info/SOURCES.txt'
running build_ext
Creating /Users/jtratner/env/lib/python2.7/site-packages/example.egg-link (link to .)
example 0.0.0 is already the active version in easy-install.pth
Installed /Users/jtratner
Processing dependencies for example==0.0.0
Searching for ipython
Reading https://pypi.python.org/simple/ipython/
Downloading https://pypi.python.org/packages/76/46/c505c48d264715136edde1a1960f9158133e34c03bbfe4c955dbc5948ce4/ipython-6.0.0rc1.tar.gz#md5=e57acb5fabd9f18b739de35a1f00eac5
Best match: ipython 6.0.0rc1
Processing ipython-6.0.0rc1.tar.gz
Writing /var/folders/h2/64h07zpd7576xz6wcq8jdzrw0000gp/T/easy_install-BGbWO9/ipython-6.0.0rc1/setup.cfg
Running ipython-6.0.0rc1/setup.py -q bdist_egg --dist-dir /var/folders/h2/64h07zpd7576xz6wcq8jdzrw0000gp/T/easy_install-BGbWO9/ipython-6.0.0rc1/egg-dist-tmp-zb3BA7
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=9, releaselevel='final', serial=0) detected.
error: Setup script exited with 1
and on the same system pip does the "right" thing
(env) $ pip install --no-cache-dir -i https://pypi.python.org/simple ipython
# snip...
Successfully installed appnope-0.1.0 backports.shutil-get-terminal-size-1.0.0 decorator-4.0.11 enum34-1.1.6 ipython-5.3.0 ipython-genutils-0.2.0 pathlib2-2.2.1 pexpect-4.2.1 pickleshare-0.7.4 prompt-toolkit-1.0.14 ptyprocess-0.5.1 pygments-2.2.0 scandir-1.5 simplegeneric-0.8.1 traitlets-4.3.2 wcwidth-0.1.7
(env) $ pip uninstall ipython
I've tested and this happens on OSX and a centos6 box I have access to.
Activity
jtratner commentedon Apr 11, 2017
(there's a secondary issue here that I think setuptools should not be pulling down an
rcrelease at all - but possibly6.0.0rc1is not a valid release candidate description? I was not clear from reading the PEP)jaraco commentedon Apr 11, 2017
easy_install doesn't exclude pre and post release versions as pip does. You should probably just use pip install -e instead of setup.py develop.
jtratner commentedon Apr 11, 2017
jaraco commentedon Apr 11, 2017
Yes, I think that's expected. Support for packages to declare which Python versions are supported is fairly new. I'm not even aware of any feature in pip to restrict packages based on Python version.
Indeed:
The only reason pip doesn't normally install 6.0rc1 by default is because it's a pre-release version. When 6.0 is released, pip will fail to install it also on Python 2.
Eventually, pip and/or warehouse will probably add support to read the metadata for the package and filter out non-viable versions. I'm not sure which package if any will do that. However, easy_install, being mostly deprecated, will not get support for these new features.
Carreau commentedon Apr 11, 2017
That was covered by pypa/pip#3877 writen in part by me, and explicitly to cover this use case. So it should not be wontfix as it is also one of the main reason to migrate to pip9. We even send PR to PyPI legacy and patch to warehouse to support this.
Carreau commentedon Apr 11, 2017
Also can you please reopen ?
jaraco commentedon Apr 11, 2017
If the issue is addressed in pip, why would we re-open this issue in setuptools?
xavfernandez commentedon Apr 11, 2017
For the record, like @Carreau pointed out, such support was added in pip 9.
(and of course, both works with Python 3.6)
Carreau commentedon Apr 11, 2017
It seem your pip is out of date, as pip 9.0.1 seem to not behave as in your screenshot.
So pip does the right thing.
jaraco commentedon Apr 11, 2017
Indeed. I was testing with stock pip on Ubuntu Trusty.
Carreau commentedon Apr 11, 2017
I'll add a line in the warning message that warn user that pip may be out of date.
tvalentyn commentedon Jul 12, 2019
I observe the same issue with
setuptools-41.0.1on Windows (but not on Linux). Usecase:a project depends on
numpy>=1.13.0. On a Windows machine with Python 2.7 andpip==19.1.1,setuptoolsfortestcommand attempts to pull an incompatible packagenumpy==1.17.0rc1, which requires Python 3.5.pip installpicks up correct version. I assume this issue is still considered WAI.