question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Setuptools pulls down incompatible version of package with develop

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
Carreaucommented, Apr 11, 2017

It seem your pip is out of date, as pip 9.0.1 seem to not behave as in your screenshot.

MacBook-Pro-4:~ bussonniermatthias$ python2 -m pip --version
pip 9.0.1 from /usr/local/lib/python2.7/site-packages (python 2.7)
MacBook-Pro-4:~ bussonniermatthias$ python2 -m pip install ipython --pre --upgrade
Collecting ipython
  Using cached ipython-5.3.0-py2-none-any.whl

So pip does the right thing.

1reaction
tvalentyncommented, Jul 12, 2019

I observe the same issue with setuptools-41.0.1 on Windows (but not on Linux). Usecase: a project depends on numpy>=1.13.0. On a Windows machine with Python 2.7 and pip==19.1.1, setuptools for test command attempts to pull an incompatible package numpy==1.17.0rc1, which requires Python 3.5. pip install picks up correct version. I assume this issue is still considered WAI.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python setup.py develop vs install - Stack Overflow
(developer install) to install packages, as invoking setup.py directly will do the wrong things for many dependencies, such as pull prereleases and incompatible...
Read more >
Development Mode (a.k.a. “Editable Installs”) - Setuptools
An “editable installation” works very similarly to a regular install with pip install . , except that it only installs your package dependencies,...
Read more >
Package List — Spack 0.20.0.dev0 documentation
This is a list of things you can install using Spack. It is automatically generated based on the packages in this Spack version....
Read more >
Python: Creating a pip installable package
This is a quickstart guide to Python Packaging with a particular focus on the creation of a PyPI package, which will enable users...
Read more >
Should You Use Upper Bound Version Constraints?
No package installer that I'm aware of handles caps on Python versions correctly - and there may not be a “correct” way, but...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found