3
I've installed python 3.6 on Ubuntu 16.04 using:
add-apt-repository ppa:jonathonf/python-3.6
Unfortunately no pip
is included. How have you solved this?
3
I've installed python 3.6 on Ubuntu 16.04 using:
add-apt-repository ppa:jonathonf/python-3.6
Unfortunately no pip
is included. How have you solved this?
1
The answer is on Stack Overflow. It consists of installing some more packages from the same ppa repo and then get pip from pypa.io. Optionnally, you might want to setup some links in order to have python3.6 be the default python3:
Let's suppose that you have a system running Ubuntu 16.04, 16.10, or 17.04, and you want Python 3.6 to be the default Python.
If you're using Ubuntu 16.04 LTS, you'll need to use a PPA:
sudo add-apt-repository ppa:jonathonf/python-3.6 # (only for 16.04 LTS)
Then, run the following (this works out-of-the-box on 16.10 and 17.04):
sudo apt update sudo apt install python3.6 sudo apt install python3.6-dev sudo apt install python3.6-venv wget https://bootstrap.pypa.io/get-pip.py sudo python3.6 get-pip.py sudo ln -s /usr/bin/python3.6 /usr/local/bin/python3 sudo ln -s /usr/local/bin/pip /usr/local/bin/pip3 # Do this only if you want python3 to be the default Python # instead of python2 (may be dangerous, esp. before 2020): # sudo ln -s /usr/bin/python3.6 /usr/local/bin/python
When you have completed all of the above, each of the following shell commands should indicate
Python 3.6.1
(or a more recent version of Python 3.6):python --version # (this will reflect your choice, see above) python3 --version $(head -1 `which pip` | tail -c +3) --version $(head -1 `which pip3` | tail -c +3) --version
Did you install the
python3-pip
package? You normally need this to get pip. – multithr3at3d – 2018-01-11T00:06:30.4771that installs
python3-pip
for python 3.5.2 not 3.6 - no package exists forpython3.6-pip
– robertmoggach – 2018-01-11T00:10:34.507interestingly creating a virtualenv using
python3.6 -m venv my_venv
creates apip3.6
in the venvbin
directory... not exactly what i wanted though – robertmoggach – 2018-01-11T00:16:02.637What about
python3.6 -m pip
? – multithr3at3d – 2018-01-11T00:16:52.833oddly... not there. that was my original attempt... – robertmoggach – 2018-01-11T00:53:42.963
I guess it's specific to that PPA; see if they have more details on it. – multithr3at3d – 2018-01-11T02:27:21.657
A simple solution:
add-apt-repository ppa:deadsnakes/ppa
– Jonas Dahlbæk – 2018-05-15T14:06:54.753