Monday, April 29, 2024
143
rated 0 times [  143] [ 0]  / answers: 1 / hits: 313141  / 2 Years ago, sat, december 4, 2021, 3:22:42

I am trying to install the Pillow module for python 3.3, but for that I need to install pip.
Every time that I install pip it installs for python 2.7, any help?


More From » software-installation

 Answers
2

2018 Update: This is still attracting upvotes which worries me.



12.04 has been unsupported for about a year now. The best way you can install pip3 is by upgrading to a newer, supported version of Ubuntu. You have 3 LTS versions to pick from.






While on more modern versions of Ubuntu you could just sudo apt-get install python3-pip (and then use pip3), a Python 3 copy of pip was never packaged for 12.04.



Therefore you need to follow the more old fashioned install route with easy_install:



sudo apt-get install python3-setuptools
sudo easy_install3 pip


Now, there is every chance that this will clash with Python 2's pip and override /usr/bin/pip, because it will install a python3 based /usr/local/bin/pip which is also in Ubuntu 12.04's $PATH.



It shouldn't overwrite it so as long as you know that, it might be acceptable. However it might be best to start investigating the happy world of virtualenv as this answer suggests.



Alternatively you could rename the easy-installed python3 version of pip:



sudo mv /usr/local/bin/pip /usr/local/bin/pip-3


Then you can confirm your existing pip is still python2.7 based:



pip --version

[#27245] Monday, December 6, 2021, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
edgehogight

Total Points: 272
Total Questions: 113
Total Answers: 99

Location: Northern Mariana Islands
Member since Sun, Jul 19, 2020
4 Years ago
edgehogight questions
Sat, Sep 11, 21, 22:09, 3 Years ago
Sat, Nov 6, 21, 19:48, 3 Years ago
Fri, Aug 26, 22, 09:37, 2 Years ago
;