在导入QSTK之前导入numpy
当我从/Library/python/2.7/site-packages运行python时,
因为pkg_的资源在
/Library/Python/2.7/site-packages/distribute-0.6.32-py2.7.egg。在
在站点.路径当我在/Library/python/2.7/site-packages中运行python时:print("\n".join(sys.path))
/Library/Python/2.7/site-packages/distribute-0.6.32-py2.7.egg
/Library/Python/2.7/site-packages/cx_Oracle-5.1.2-py2.7-macosx-10.8-intel.egg
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC
/Library/Python/2.7/site-packages/PIL
/Library/Python/2.7/site-packages/setuptools-0.6c11-py2.7.egg-info
在站点.路径当我在外面运行/Library/Python/2.7/site-packages时print("\n".join(sys.path))
/Library/Python/2.7/site-packages/distribute-0.6.32-py2.7.egg
/Library/Python/2.7/site-packages/cx_Oracle-5.1.2-py2.7-macosx-10.8-intel.egg
/Library/Python/2.7/site-packages
/Users/ssgam/QSTK
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC
/Library/Python/2.7/site-packages/PIL
/Library/Python/2.7/site-packages/setuptools-0.6c11-py2.7.egg-info
注意,第一行是空的,不是/Library/Python/2.7/site-packages。
看起来包的加载/查找顺序有问题。
设置后
PYTHONPATH=/Library/Python/2.7/site packages/distribute-0.6.32-py2.7.egg
出口Python
问题解决了。