pip ausente de python3.6 instalar no Ubuntu 16.04

2

Instalei o python 3.6 no Ubuntu 16.04 usando:

add-apt-repository ppa:jonathonf/python-3.6

Infelizmente, nenhum pip está incluído. Como você resolveu isso?

    
por mogga 11.01.2018 / 01:01

1 resposta

0

A resposta está no Stack Overflow. Consiste em instalar mais alguns pacotes do mesmo ppa repo e depois obter o pip do pypa.io. Opcionalmente, você pode querer configurar alguns links para que o python3.6 seja o padrão 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

Fonte

    
por 09.09.2018 / 12:00