python安装wxpython的错误提示_安装wxPython的Python导入错误

我已经安装了wxPython,方法是按照这个answer的说明,在ubuntu14.04中使用以下命令

sudo apt-get install python-wxgtk2.8 python-wxtools wx2.8-doc wx2.8-examples wx2.8-headers wx2.8-i18n

一切都安装好了。在

但是当我在代码中执行import wx操作时,我得到了以下错误。在Python 2.7.6 (default, Mar 22 2014, 22:59:38)

[GCC 4.8.2] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>> import wx

Traceback (most recent call last):

File "", line 1, in

ImportError: No module named wx

在我的代码中使用wxPython需要安装什么吗?在

编辑:

安装wxPython的目录位于系统路径在

^{pr2}$

从上面的输出中我们可以看到它安装在/usr/lib/python2.7/dist-packages中,当我打印sys.path时,这个路径就包含在内了。在$ python

Python 2.7.6 (default, Mar 22 2014, 22:59:38)

[GCC 4.8.2] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>> import sys

>>> print sys.path

['', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-i386-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PILcompat', '/usr/lib/python2.7/dist-packages/gst-0.10', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/pymodules/python2.7', '/usr/lib/python2.7/dist-packages/ubuntu-sso-client']

编辑2:

我还确保使用的python版本正确。在~$ which python

/usr/bin/python

~$ ll /usr/bin/python

lrwxrwxrwx 1 root root 9 Dec 21 2013 /usr/bin/python -> python2.7*

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值