Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to run pip for python 3 and python 2

I have two versions of python installed on my machine (Ubuntu 14.xx LTE) as well as two versions of pip (one for python 2 and one for python 3). When I run pip --version on the command line I get the following output: pip 1.5.4 from /usr/lib/python2.7/dist-packages (python 2.7). I looked into this directory and it has many other things in it. However I couldn't find pip.py in it. How do I run pip for python 3? Any help is appreciated.

like image 613
flashburn Avatar asked Jan 08 '23 14:01

flashburn


1 Answers

To use another version of pip for python on ubuntu, you can use the python major version after pip. For Example:

pip --version

will return the default version of pip

pip2 --version

will use the Python 2 version of pip, and

pip3 --version

will use Python 3.

Hope this helped!

like image 94
HeroCC Avatar answered Jan 15 '23 09:01

HeroCC