pip install --user ignores system-installed dependencies, installs older versions #4222

akkana opened this Issue Jan 8, 2017 · 0 comments


None yet

1 participant

akkana commented Jan 8, 2017
  • Pip version: 9.0.1
  • Python version: 2.7.13
  • Operating System: Debian testing (stretch)


pip install --user, on a package that has depedencies, ignores the debian-installed dependencies and installs a different (perhaps quite a bit older) version from pypi.

In particular: In https://github.com/matplotlib/mpl_finance I run python setup.py sdist
That setup.py includes: install_requires=['matplotlib']
I have 2.0.0~rc2-1 installed as part of the python-matplotlib debian package.

pip show matplotlib sees it:
Name: matplotlib
Version: 2.0.0rc2
Summary: Python plotting package
Home-page: http://matplotlib.org
Author: John D. Hunter, Michael Droettboom
Author-email: matplotlib-users@python.org
License: BSD
Location: /usr/lib/python2.7/dist-packages

But if I run: pip install --user dist/mpl_finance-0.10.0.tar.gz
pip will download matplotlib version 1.5.3 from pypi and install it in ~/.local/lib. (This causes everything to break, because that version of matplotlib has a bug that makes it not work on linux 32-bit.) It also downloads a bunch of matplotlib dependencies that are also already installed in the system.

This is wrong according to https://pip.pypa.io/en/stable/user_guide/#user-installs :
"When globally installed packages are on the python path, and they satisfy the installation requirements, pip does nothing, and reports that requirement is satisfied (similar to how global packages can satisfy requirements when installing packages in a --system-site-packages virtualenv)."

It's not because the system matplot lib is a release candidate: if I add --pre to the pip install line, it will download matplotlib 2.0.0rc2 (same as my system version) from pypi.

If I install (without --user) in a virtualenv --system-site-packages, things work right, it sees the system matplotlib and doesn't install the older one or any other packages. It's just with --user that it breaks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment