我安装了wxPython 3.0.1.1
,但我无法import wx
使用Python 3.4.1
。我收到以下错误:如何使用wxPython for Python 3?
Python 3.4.1 (v3.4.1:c0e311e010fc, May 18 2014, 00:54:21)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import wx
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'wx'
不过,我可以import wx
如果我(在我OS X 10.9
默认安装)使用Python 2.7
:
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
>>>
我如何使用wxPython的为Python 3,具体为Python 3.4.1?
也许你需要手动模块的位置添加到您的'SYS。路径: 'sys.path.insert(“/ location/of/wx”)' 这里是一个更详细的描述:http://stackoverflow.com/questions/279237/import-a-module-from-一个相对路径 – jotrocken 2014-10-08 07:27:34
@jotrocken我怎么能这样做,它将永久? – Nick 2014-10-08 07:29:43
http://stackoverflow.com/questions/3402168/permanently-add-a-directory-to-pythonpath – jotrocken 2014-10-08 07:31:24