我无法简单地使用pip install pandas,因为我的系统已经为python3安装了它。但我预计pip会尝试为python2安装;pip3应该为python3安装。
为什么必须指定python2解释器才能使用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)
...发布于 2017-01-13 01:59:26
pip将调用系统上默认版本的pip。它不是特定于python2的。由于您的系统默认使用python3,因此需要指定python2 -m pip才能访问python2版本。
https://stackoverflow.com/questions/41619855
复制相似问题