Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip breaks installed packages unrelated to the one installed (or their dependencies) #6494

Closed
davidedelvento opened this issue May 10, 2019 · 1 comment
Labels
auto-locked Outdated issues that have been locked by automation resolution: duplicate Duplicate of an existing issue/PR type: bug A confirmed bug or unintended behavior

Comments

@davidedelvento
Copy link

Environment

  • pip version: 19.1.1
  • Python version: 3.5
  • OS: CentOS Linux release 7.4.1708

In the NVIDIA-provided 18.10-py3 container

> python --version
Python 3.5.2
> pip --version
pip 19.1.1 from /home/ddvento/.local/lib/python3.5/site-packages/pip (python 3.5)

Description
I need to add packages (describing just one for the sake of the issue) to my environment. Since the NVIDIA container does not provide venv I am using pip's -t option instead.

> python -m venv my_env
The virtual environment was not created successfully because ensurepip is not
available.  On Debian/Ubuntu systems, you need to install the python3-venv
package using the following command.

    apt-get install python3-venv

You may need to use sudo with that command.  

I don't have root on this machine (not even in the container) so I do:

> export PYTHONPATH=/tmp/test_env/
> pip install patsy -t $PYTHONPATH 

Expected behavior
Running the previous should either install patsy and its dependencies, or not. Hopefully the former. Instead it breaks a third package.

How to Reproduce

> pip show numpy
Name: numpy
Version: 1.14.5
Summary: NumPy: array processing for numbers, strings, records, and objects.
Home-page: http://www.numpy.org
Author: Travis E. Oliphant et al.
Author-email: None
License: BSD
Location: /usr/local/lib/python3.5/dist-packages
Requires: 
Required-by: tensorflow-gpu, tensorboard, scipy, scikit-learn, resampy, pandas, numba, matplotlib, librosa

> pip show tensorflow-gpu
Name: tensorflow-gpu
Version: 1.10.0+nv
Summary: TensorFlow is an open source machine learning framework for everyone.
Home-page: https://www.tensorflow.org/
Author: Google Inc.
Author-email: opensource@google.com
License: Apache 2.0
Location: /usr/local/lib/python3.5/dist-packages
Requires: numpy, grpcio, astor, six, tensorboard, termcolor, protobuf, gast, wheel, setuptools, absl-py
Required-by: 

> pip show patsy

> 

Notice how patsy is not originally installed.

Output

> pip install patsy -t $PYTHONPATH 
Collecting patsy
  Using cached https://files.pythonhosted.org/packages/ea/0c/5f61f1a3d4385d6bf83b83ea495068857ff8dfb89e74824c6e9eb63286d8/patsy-0.5.1-py2.py3-none-any.whl
Collecting six (from patsy)
  Using cached https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Collecting numpy>=1.4 (from patsy)
  Using cached https://files.pythonhosted.org/packages/f6/f3/cc6c6745347c1e997cc3e58390584a250b8e22b6dfc45414a7d69a3df016/numpy-1.16.3-cp35-cp35m-manylinux1_x86_64.whl
ERROR: tensorflow-gpu 1.10.0+nv has requirement numpy<=1.14.5,>=1.13.3, but you'll have numpy 1.16.3 which is incompatible.
Installing collected packages: six, numpy, patsy
Successfully installed numpy-1.16.3 patsy-0.5.1 six-1.12.0

This is related to #5178 and probably #988 (the mother of all my anger about pip)

@pradyunsg pradyunsg added the S: needs triage Issues/PRs that need to be triaged label May 27, 2019
@chrahunt chrahunt added resolution: duplicate Duplicate of an existing issue/PR type: bug A confirmed bug or unintended behavior labels Sep 1, 2019
@triage-new-issues triage-new-issues bot removed the S: needs triage Issues/PRs that need to be triaged label Sep 1, 2019
@chrahunt
Copy link
Member

chrahunt commented Sep 1, 2019

As mentioned in #5178, -t also unfortunately implies --ignore-installed. Since this is just a side-effect of the issue described there (and you have contributed the same information on that issue), I will close this one. Please also check out #4575 where some of the details of the relationship between --target and the other types of environments pip installs into are being discussed.

@chrahunt chrahunt closed this as completed Sep 1, 2019
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Oct 2, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation resolution: duplicate Duplicate of an existing issue/PR type: bug A confirmed bug or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants