【发布时间】:2016-05-19 01:39:33
【问题描述】:
我已经使用 pip (2.x) 和 pip-3.5 成功安装了 gnureadline。虽然在 Python2.7 中导入它可以完美运行,但在 Python 3.5 中它会引发以下异常:
Python 3.5.1 (default, Jan 31 2016, 04:03:04)
[GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import gnureadline
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: dlopen(/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/gnureadline.so, 2): Symbol not found: _PyInt_AsLong
Referenced from: /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/gnureadline.so
Expected in: flat namespace
in /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/gnureadline.so
奇怪的是python在Python2.7的路径中寻找包。
平台是 OSX 10.11.3。
【问题讨论】:
-
sys.path的值是多少?
标签: python macos python-3.5