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 invocation warning in bindings test #186

Open
fsimonis opened this issue Feb 26, 2020 · 3 comments
Open

pip invocation warning in bindings test #186

fsimonis opened this issue Feb 26, 2020 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@fsimonis
Copy link
Member

fsimonis commented Feb 26, 2020

Test: bindings.Ubuntu1604.home

In step 13/35 : RUN pip3 install --user .

I receive the following warning:

Successfully built pyprecice mpi4py
Installing collected packages: mpi4py, numpy, pyprecice
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
  WARNING: The scripts f2py, f2py3 and f2py3.5 are installed in '/home/precice/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed mpi4py-3.0.3 numpy-1.18.1 pyprecice-2.0.0.2

edit: For the first warning, refer to this issue. For the second warning, refer to #195.

@fsimonis fsimonis changed the title pip invokation warning in bindings test pip invocation warning in bindings test Feb 26, 2020
@BenjaminRodenberg BenjaminRodenberg self-assigned this Feb 27, 2020
@BenjaminRodenberg BenjaminRodenberg added the enhancement New feature or request label Feb 27, 2020
@BenjaminRodenberg
Copy link
Member

WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.

Developer perspective

This warning can be avoided (at least locally on my system) by calling pip instead of pip3. We should carefully check whether pip refers to pip2 or pip3 in the setups that we use for testing before changing it.

Only because we can change it does not mean we should change it: It might be a good idea to intentionally keep this warning until it will fail in a future version of pip. If we keep using pip3, which will trigger the warning, our tests will tell us when this future version of pip has arrived and we have to update our documentation (see below).

User perspective

We should also make sure to update our python-related documentation correspondingly (we do not want to recommend using pip3, if this throws a warning). Here, it might be worth waiting a bit longer, since pip3 always explicitly points to pip for python3 while just calling pip might also refer to a pip for python2 (see below). Note that we do not support python2. I also noticed that the warning is only thrown for quite recent pip versions (18.1, default on Ubuntu 19.10 does not give me the warning; 20.0.2 gives me the warning).

I did a quick check for different Ubuntu versions in docker trying to understand how pip points to pip2/pip3. Note that for all Ubuntu images I tested pip actually points to pip2 (see below). However, on my system (Ubuntu 18.04), pip points to pip3. Pure speculation: This might be due to the fact that the Ubuntu docker images are minimal images (no pre-installed pip), while a local installation of Ubuntu is not-minimal (comes with pip).

Therefore, I think it is a safe option to stick to pip3 with respect to documentation. Especially, since the warning is only thrown for recent pip versions. And: a warning is not an error. As soon as the warning becomes an error (This will fail in a future version of pip.), we should reconsider this issue.

Ubuntu 14.04 docker run -ti ubuntu:14.04

$ apt update && apt install python-pip python3-pip     
$ pip2 --version
pip 1.5.4 from /usr/lib/python2.7/dist-packages (python 2.7)
$ pip3 --version
pip 1.5.4 from /usr/lib/python3/dist-packages (python 3.4)
$ pip --version
pip 1.5.4 from /usr/lib/python2.7/dist-packages (python 2.7)

Ubuntu 16.04 docker run -ti ubuntu:16.04

$ apt update && apt install python-pip python3-pip
$ pip2 --version
pip 8.1.1 from /usr/lib/python2.7/dist-packages (python 2.7)
$ pip3 --version
pip 8.1.1 from /usr/lib/python3/dist-packages (python 3.5)
$ pip --version
pip 8.1.1 from /usr/lib/python2.7/dist-packages (python 2.7)

Ubuntu 18.04 docker run -ti ubuntu:18.04

$ apt update && apt install python-pip python3-pip
$ pip2 --version
pip 9.0.1 from /usr/lib/python2.7/dist-packages (python 2.7)
$ pip3 --version
pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)
$ pip --version
pip 9.0.1 from /usr/lib/python2.7/dist-packages (python 2.7)

Ubuntu 19.10 docker run -ti ubuntu:19.10

$ apt update && apt install python-pip python3-pip
$ pip3 --version
pip 18.1 from /usr/lib/python3/dist-packages/pip (python 3.7)
$ pip --version
pip 18.1 from /usr/lib/python2.7/dist-packages/pip (python 2.7)
$ pip2 --version
pip 18.1 from /usr/lib/python2.7/dist-packages/pip (python 2.7)

@BenjaminRodenberg
Copy link
Member

I opened a second issue #195 for the second warning mentioned above:

  WARNING: The scripts f2py, f2py3 and f2py3.5 are installed in '/home/precice/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

Let's only worry about

WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.

in this issue.

@fsimonis
Copy link
Member Author

This issue will disappear if we call pip via the correct python instead of calling the pip wrapper. Correct?

- pip3 install --user .
+ python3 -m pip install --user .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants