在Mac上,
which python
给出/Library/Frameworks/Python.framework/Versions/2.7/bin/python
$ pip install wxpython
Requirement already satisfied: wxpython in /usr/local/lib/python2.7/site-packages/wx-3.0-osx_cocoa (3.0.2.0)
但是,导入wx
会引发错误
>>> import wx
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/site-packages/wx-3.0-osx_cocoa/wx/__init__.py", line 45, in <module>
from wx._core import *
File "/usr/local/lib/python2.7/site-packages/wx-3.0-osx_cocoa/wx/_core.py", line 4, in <module>
import _core_
ImportError: dlopen(/usr/local/lib/python2.7/site-packages/wx-3.0-osx_cocoa/wx/_core_.so, 2): Symbol not found: _PyUnicodeUCS2_AsWideChar
Referenced from: /usr/local/lib/python2.7/site-packages/wx-3.0-osx_cocoa/wx/_core_.so
Expected in: flat namespace
in /usr/local/lib/python2.7/site-packages/wx-3.0-osx_cocoa/wx/_core_.so
这是因为python问题吗?尝试进行修复,但无法意识到python的问题。你能帮我吗?