如何设置python模块(导入)问题?

时间:2018-10-14 06:39:58

标签: macos python-2.7

在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的问题。你能帮我吗?

0 个答案:

没有答案