我在Ubuntu 12.04 LTS(http://code.google.com/p/cefpython/)中安装了cefpython的64位软件包。问题是我无法运行这些示例。它说没有名为wx的模块。 但是,当我导航到目录/usr/local/lib/python2.7/dist-packages/cefpython1,并导入wx它的作品。所以基本上我无法在该目录之外导入wx。我在终端上使用python解释器。只能够在安装目录中导入python模块
rishi:cefpython1 ls
cefclient cefpython_py27.pyc chrome.pak examples __init__.pyc LICENSE.txt wx
cefpython_py27.py cefpython_py27.so devtools_resources.pak __init__.py libcef.so locales
rishi:cefpython1 python
Python 2.7.3 (default, Sep 26 2013, 20:03:06)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import wx
>>>
[2]+ Stopped python
rishi:cefpython1 cd ..
rishi:dist-packages python
Python 2.7.3 (default, Sep 26 2013, 20:03:06)
[GCC 4.6.3] on linux2
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
>>>
KeyboardInterrupt
>>>
我的路径如下所示和PYTHONPATH是空的:在Ubuntu cefpython的 安装64位包12.04 LTS(http://code.google.com/p/cefpython/)。问题是我无法运行这些示例。它说没有名为wx的模块。但是,当我导航到/usr/local/lib/python2.7/dist-packages/cefpython1目录并导入wx时,它会起作用。所以基本上我无法在该目录之外导入wx。我在终端上使用python解释器。
rishi:dist-packages echo $PATH
/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
rishi:dist-packages echo $PYTHONPATH
rishi:dist-packages echo $PYTHONPATH
rishi:dist-packages
你的'PATH'和'PYTHONPATH'是什么样的? –
@SnakesandCoffee更新。 PYTHONPATH是空的。 – rishiag
我的PYTHONPATH也是空的,例子工作正常。我已经通过Ubuntu软件中心安装了“python-wxtools”软件包来安装wx库,您可以试试看。 –