How to install Pip for a particular version of Python?

Asked

Viewed 2,160 times

7

I have Ubuntu 17.10 installed and it came with Python 2.7 and 3.6.

I installed Python 3.4 but I can’t install Pip on it, it always goes to the latest version with pip3 which is 3.6 How can I install in 3.4?

  • 2

    How you installed Python 3.4?

  • in the sudo terminal apt-get install python3.4. later on the cd terminal /usr/src unzipped the Python-3.4.4.tgz file with tar txzf Python-3.4.4 and used the commands . /configure after make, make test and then sudo make install

  • First check which version of Python is currently running with python --version and tell us please.

  • It is 3.4.4 that because I edited debian_defaults by placing defaults_version=python3.4 located in /usr/share/python and created the symbology link sudo rm /usr/bin/python (this was to remove the link) and used ln -s /usr/bin/python3.4 /usr/bin/python

2 answers

4

I recommend running the script get-Pip.py as described in documentation of them.

Simply download the file and run using the python you want to have Pip:

python get-pip.py

or

python3 get-pip.py

or

python2 get-pip.py

or using the full path if you installed python yourself for example:

/home/avraham/.pythonz/pythons/CPython-3.4.6/bin/python3 get-pip.py
  • Thanks for the feedback. I tried to run get-Pip.py with the command python3.4 get-Pip and the following message appears python3.4 can't open file 'get-pip.py' no such file or diretory. I was also unable to locate the hidden folder from the terminal (.pythonz). how should I proceed?

  • Another observation I entered the location where the get-Pip.py is and tried to run with python3.4 and it appears to msg zipimport.zipimporting: can’t Decompress data; zlib not avaible. I installed the zlib1g but still occurs this msg

  • My python 3.4 is in /usr/local it also came with the ensure Pip folder in it has two whl packets Pip-7.1.2-py2.py3-None-any.whl as I can unzip by terminal?

  • You’d probably have to recompile the python. i recommend using pythonz, it greatly simplifies life, it downloads and compiles the specific version you want

  • Thanks tovmeod’s had to recompile the python itself. But I used virtualvenv to be able to install the packages I wanted in 3.4. I’ll keep it that way if more people have this problem. Thanks

0

Browser other questions tagged

You are not signed in. Login or sign up in order to post.