sgt*_*per 2 python homebrew easy-install pandas
我试过安装
python setup.py install进入提取的焦油球目录)pipeasy_install但似乎什么都没有用......我已经下载并升级了xcode,安装了命令行工具..我克隆了pandas的github存储库
cd ../pandas
python setup.py install
running install
running bdist_egg
running egg_info
writing requirements to pandas.egg-info/requires.txt
writing pandas.egg-info/PKG-INFO
writing top-level names to pandas.egg-info/top_level.txt
writing dependency_links to pandas.egg-info/dependency_links.txt
reading manifest file 'pandas.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'setupegg.py'
no previously-included directories found matching 'doc/build'
warning: no previously-included files matching '*.so' found anywhere in distribution
warning: no previously-included files matching '*.pyd' found anywhere in distribution
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '.DS_Store' found anywhere in distribution
writing manifest file 'pandas.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.6-intel/egg
running install_lib
running build_py
copying pandas/version.py -> build/lib.macosx-10.6-intel-2.7/pandas
running build_ext
**gcc-4.2 not found, using clang instead**
building 'pandas.index' extension
clang -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -O2 -DNDEBUG -g -O3 -I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include -Ipandas/src/klib -Ipandas/src -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c pandas/index.c -o build/temp.macosx-10.6-intel-2.7/pandas/index.o
In file included from pandas/index.c:260:
In file included from pandas/src/klib/khash_python.h:3:
pandas/src/klib/khash.h:573:1: warning: expression result unused [-Wunused-value]
KHASH_MAP_INIT_STR(str, size_t)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pandas/src/klib/khash.h:565:2: note: expanded from macro 'KHASH_MAP_INIT_STR'
KHASH_INIT(name, kh_cstr_t, khval_t, 1, kh_str_hash_func, kh_str_hash_equal)
^
Run Code Online (Sandbox Code Playgroud)
---更多的输出......最后
Installed /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site- packages/pandas-0.10.1.dev_c934e02-py2.7-macosx-10.6-intel.egg
Processing dependencies for pandas==0.10.1.dev-c934e02
Searching for pytz
Reading http://pypi.python.org/simple/pytz/
Reading http://pytz.sourceforge.net
Reading http://sourceforge.net/project/showfiles.php?group_id=79122
Reading http://www.stuartbishop.net/Software/pytz
Reading http://sourceforge.net/projects/pytz/
Best match: pytz 2012h
Downloading http://pypi.python.org/packages/2.7/p/pytz/pytz-2012h-py2.7.egg#md5=4258fcfc023e9ff0057405d935fc6e1d
Processing pytz-2012h-py2.7.egg
creating /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pytz-2012h-py2.7.egg
Extracting pytz-2012h-py2.7.egg to /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
Adding pytz 2012h to easy-install.pth file
Installed /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pytz-2012h-py2.7.egg
-----
Installed /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/six-1.2.0-py2.7.egg
Searching for numpy==1.6.2
Best match: numpy 1.6.2
Adding numpy 1.6.2 to easy-install.pth file
Using /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
Finished processing dependencies for pandas==0.10.1.dev-c934e02
ipython
Python 2.7.3 (v2.7.3:70274d53c1dd, Apr 9 2012, 20:52:43)
Type "copyright", "credits" or "license" for more information.
IPython 0.14.dev -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: import pandas
Run Code Online (Sandbox Code Playgroud)
似乎没有问题..
当我使用easy_install安装pandas时,屏幕输出似乎表明它工作但是在加载时,python无法找到库
sudo easy_install pandas
Searching for pandas
Best match: pandas 0.10.1.dev-c934e02
Processing pandas-0.10.1.dev_c934e02-py2.7-macosx-10.8-intel.egg
pandas 0.10.1.dev-c934e02 is already the active version in easy-install.pth
Using /usr/local/lib/python2.7/site-packages/pandas-0.10.1.dev_c934e02-py2.7-macosx-10.8-intel.egg
Processing dependencies for pandas
Finished processing dependencies for pandas
dekumar-mn:ipython dekumar$ python
Python 2.7.3 (v2.7.3:70274d53c1dd, Apr 9 2012, 20:52:43)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas as pd
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named pandas
Run Code Online (Sandbox Code Playgroud)
您有多个版本的Python 2.7.您安装pandas了一个版本,然后尝试将其导入另一个版本,但您不能这样做,因为它们具有单独的站点库.
如果由于某种原因需要多个版本的Python 2.7,则必须学习如何管理多个版本的Python.例如,始终确定您是否正在使用/usr/bin/easy_install或/usr/local/bin/easy_install使用与python您计划运行的一个.
但是你可能不需要多个版本.如果您只是卸载非Apple产品,那么一切都会轻松得多.
您可以从日志中的路径中找出详细信息.手动安装进入/Library/Python/2.7/site-packages,这是Apple的/usr/bin/python外观.但是easy_install去了/usr/local/lib/python/2.7/site-packages,这是第三方(可能是Homebrew,来自brew标签?)/usr/local/bin/python.很明显,python你的道路上/usr/bin/python的第一个easy_install是,而第一个是/usr/local/bin/easy_install.这会导致混乱,就像它在这里所做的那样.
更糟糕的是,如果你安装ipython到两个Pythons中,那么你安装的第二个最终将会结束/usr/local/bin/ipython,这将导致更加混乱.
如果这样做sudo /usr/bin/easy_install pandas,您可以pandas在Apple Python中使用.为了确保你运行的那个,总是做/usr/bin/python或/usr/bin/python /usr/local/bin/ipython.如果这样做sudo /usr/local/bin/easy_install pandas,您可以pandas在第三方Python中使用.为了确保你运行的那个,总是做/usr/local/bin/python或/usr/local/bin/python /usr/local/bin/ipython.
看看你的评论和更详细的编辑,你可能在这里实际上有两个第三方Pythons,这让事情变得更加混乱.如果他们两个都喜欢/usr/local/bin(除非你使用MacPorts或Fink,他们这样做),你可能会让其中一个被另一个半覆盖,并且你无法让它工作.如果是这样的话,我会建议你做一些激进的事情.如果你不愿意至少从头开始安装OS X rm -rf /usr/local /Library/Python ~/Library/Python,那么重新安装brew以及你需要的任何其他第三方内容,这一次确保只安装一个额外的Python (虽然零仍然会更好!).
同时,两个小方注:
这几乎总是最好使用pip比easy_install.如果你没有它,sudo easy_install pip现在就可以了.("差不多"的唯一常见例外是为了pip它自己,也是为了readline.)
不要sudo与Homebrew一起使用.Homebrew经历了很多麻烦来设置它触及的所有目录,所以你永远不需要sudo.一旦你开始做sudo brew,sudo /usr/local/bin/easy_install等等,你最终打破了,所以后来的安装得到许可的错误,它需要大量的工作用的brew doctor修复一切.
| 归档时间: |
|
| 查看次数: |
13882 次 |
| 最近记录: |