Search code examples
pipubuntu-16.04python-3.6python-3.5

Pointing pip3 to python3.5 instead of python3.6


I just recently installed pip (3.6) by building it with python3.6 on my Ubuntu 16.04 LTS system.

wget https://bootstrap.pypa.io/get-pip.py
python3.6 get-pip.py

This completed successfully but changed the pip3 binary under /usr/local/bin/pip3 to correspond to /usr/local/lib/python3.6/dist-packages/pip (python 3.6) instead of /usr/local/lib/python3.5/dist-packages/pip (python 3.5)

I have tried,

sudo update-alternatives --install /usr/local/bin/pip3 pip3 /usr/local/lib/python3.5/dist-packages/pip 1

to make sudo update-alternatives --config pip3 work and finally point to python3.5 dist-packages.

The error that i am getting,

update-alternatives: warning: forcing reinstallation of alternative /usr/local/lib/python3.5/dist-packages/pip because link group pip3 is broken
update-alternatives: warning: not replacing /usr/local/bin/pip3 with a link

Please advice, Thanks.


Solution

  • Pointing pip3 to python3.5 instead of python3.6

    python3.5 $(which pip3) install <your-package-name>