【发布时间】:2017-11-01 13:35:12
【问题描述】:
pandas 和pandasql 都是通过pip 安装的,并且对python 的系统/macos 版本可见。它们对安装的brew 不可见python:它们导致
ImportError: No module named pandas
我也尝试过brew 特定的点子:
$/usr/local/Cellar/python/2.7.14/libexec/bin/pip install pandasql
Requirement already satisfied: pandasql in /Library/Python/2.7/site-packages
Requirement already satisfied: numpy in /Users/sboesch/Library/Python/2.7/lib/python/site-packages (from pandasql)
Requirement already satisfied: sqlalchemy in /Library/Python/2.7/site-packages (from pandasql)
Requirement already satisfied: pandas in /Library/Python/2.7/site-packages (from pandasql)
Requirement already satisfied: pytz>=2011k in /Library/Python/2.7/site-packages (from pandas->pandasql)
Requirement already satisfied: python-dateutil in /Users/sboesch/Library/Python/2.7/lib/python/site-packages (from pandas->pandasql)
Requirement already satisfied: six>=1.5 in /Users/sboesch/Library/Python/2.7/lib/python/site-packages (from python-dateutil->pandas->pandasql)
那么为什么pip/pip2 和brew 版本的python 不一致呢?如何解决这个问题?
注意:我也尝试过使用pip 的brew 版本,以确保:它给出了相同的结果。
$which pip
/usr/local/Cellar/python/2.7.14/libexec/bin/pip
【问题讨论】:
-
Brew 将 Python 安装到
/usr/local。您的pip显然是指系统/Library/Python 安装。它们是两种不同的安装。 -
@deceze 那么
brewpython 使用了 whichpip(或诸如pip2之类的派生词)?我专门使用了brew中的pip!$which pip /usr/local/Cellar/python/2.7.14/libexec/bin/pip -
pip2不同,是的。在 that 上运行 which -
您可能只想使用
python -m pip install并依赖 Python 安装本身