Which version of Python did pip or easy_install refer to by default?

181 views Asked by At

I am a non-programmer who started to learn Python. My Mac OS X Yosemite shipped with Python 2.7.6. I installed Python 3.4.2 too. If I use pip or easy_install in the terminal to install a package, how do I know which Python I installed the package in? It seems Python 3.4.2 shipped with pip and easy_install, but I think Python 2.7.6 may also have some version of pip or easy_install. I know my system can have both versions of Python, but can it have multiple versions of pip or easy_install?

2

There are 2 answers

2
MattDMo On BEST ANSWER

There's an easy way around it - use pip2 or pip2.7 or pip-2.7 for Python 2, and pip3 or pip3.4 or pip-3.4 for Python 3. Both version ship with easy_install, but Python 2 does not contain pip by default - you have to install it yourself.

1
John La Rooy On
pip -V

to find the default python version

If you have multiple versions, they will usually be named pip2 for Python2, pip3 for Python3 etc

You really shouldn't be using easy_install anymore