Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between pip and python2 -m pip?

Tags:

python

pip

I was unable to simply pip install pandas because my system already had it installed for python3. But I expected that pip would attempt to install for python2; pip3 should install for python3.

Why do I have to specify the python2 interpreter to use pip?

➜  ~ pip install pandas
Requirement already satisfied: pandas in /usr/local/lib/python3.5/site-packages
Requirement already satisfied: numpy>=1.7.0 in /usr/local/lib/python3.5/site-packages (from pandas)

➜  ~ python2 -m pip install pandas
Collecting pandas
Downloading pandas-0.19.2-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (11.9MB)
...
like image 960
vaer-k Avatar asked May 31 '26 08:05

vaer-k


1 Answers

pip will call the pip that is in the default version of python on your system. It is not specific to python2. Since python3 is default on your system you need to specify python2 -m pip to access the python2 version.

like image 96
dstudeba Avatar answered Jun 02 '26 21:06

dstudeba