Public bug reported:

If the environment variables PYTHONUSERBASE is set, regardless of what
it's set to, pip3 will install packages to /usr/lib/python-x.y/site-
packages, which isn't in the interpreter's default search path.

Big-Kahuna:~ jginsberg$ docker run -it --rm=true ubuntu:xenial bash
root@5fd4377b5952:/# apt-get update && apt-get -y install python3 python3-pip
(... snip ...)
root@5fd4377b5952:/# pip3 install django
Collecting django
  Downloading Django-1.11.1-py2.py3-none-any.whl (6.9MB)
    100% |################################| 7.0MB 262kB/s 
Collecting pytz (from django)
  Downloading pytz-2017.2-py2.py3-none-any.whl (484kB)
    100% |################################| 491kB 3.2MB/s 
Installing collected packages: pytz, django
Successfully installed django-1.11.1 pytz-2017.2
You are using pip version 8.1.1, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
root@5fd4377b5952:/# find . -type d -name django
./usr/local/lib/python3.5/dist-packages/django
./usr/local/lib/python3.5/dist-packages/django/forms/jinja2/django
./usr/local/lib/python3.5/dist-packages/django/forms/templates/django
root@5fd4377b5952:/# exit
Big-Kahuna:~ jginsberg$ docker run -it --rm=true ubuntu:xenial bash
root@446d9529fb6c:/# export PYTHONUSERBASE=/yourmom
root@446d9529fb6c:/# apt-get update && apt-get -y install python3 python3-pip
(... snip ...)
root@446d9529fb6c:/# pip3 install Django
Collecting Django
  Downloading Django-1.11.1-py2.py3-none-any.whl (6.9MB)
    100% |################################| 7.0MB 240kB/s 
Collecting pytz (from Django)
  Downloading pytz-2017.2-py2.py3-none-any.whl (484kB)
    100% |################################| 491kB 1.3MB/s 
Installing collected packages: pytz, Django
Successfully installed Django pytz
You are using pip version 8.1.1, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
root@446d9529fb6c:/# find . -type d -name django
./usr/lib/python3.5/site-packages/django
./usr/lib/python3.5/site-packages/django/forms/jinja2/django
./usr/lib/python3.5/site-packages/django/forms/templates/django
root@446d9529fb6c:/#

** Affects: python-pip (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1694560

Title:
  pip installs to /usr/lib/python-x.y/site-packages if PYTHONUSERBASE is
  set

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python-pip/+bug/1694560/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to