【发布时间】:2014-10-10 18:56:37
【问题描述】:
我在 2012 年“安装了 brew”wxmac。最近,我“brew 升级”然后“清理”了。从那以后,我就不能再导入wx了:
Python 2.7.5 (default, Mar 9 2014, 22:15:05)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import wx
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Python/2.7/site-packages/wx-2.9.4-osx_cocoa/wx/__init__.py", line 45, in <module>
from wx._core import *
File "/Library/Python/2.7/site-packages/wx-2.9.4-osx_cocoa/wx/_core.py", line 4, in <module>
import _core_
ImportError: dlopen(/Library/Python/2.7/site-packages/wx-2.9.4-osx_cocoa/wx/_core_.so, 2): Library not loaded: /opt/local/lib/libwx_osx_cocoau_xrc-2.9.4.0.0.dylib
Referenced from: /Library/Python/2.7/site-packages/wx-2.9.4-osx_cocoa/wx/_core_.so
Reason: image not found
看起来我现在有一个比 2.9.4 更新的版本:
brew install wxmac
Warning: wxmac-3.0.1 already installed
查看我的 Python 安装,这些是相关文件:
ls /Library/Python/2.7/site-packages/
wx
wx-2.9.4-osx_cocoa
wx.pth
wxPython_common-2.9.4.0-py2.7.egg-info
wxversion.py
wxversion.pyc
我怀疑“brew cleanup”删除了我较旧但工作的 wxmac 版本。现在,wxmac 版本或某些符号链接导致了当前问题。我应该如何解决或解决它?
【问题讨论】:
标签: python python-2.7 homebrew wxwidgets