ubuntu 13.04 python2.7无法导入matplotlib等模块

时间:2013-08-23 06:35:38

标签: python ubuntu python-2.7 matplotlib tkinter

我刚刚安装了matplotlib来生成一些图。但是这个模块不能在python解释器中导入。虽然它可以在ipython中导入,但是当我使用ipython来执行这些示例时。它没有显示任何东西......

除此之外,我也不能使用空闲。

 IDLE can't import Tkinter.  Your Python may not be configured for Tk. 

我的操作系统是ubuntu 13.04,默认的python版本是3.0。但我手动安装python 2.7。

我的python配置有什么问题。

我的python路径是

['', '/usr/local/lib/python27.zip', '/usr/local/lib/python2.7', '/usr/local/lib/python2.7/plat-linux2', '/usr/local/lib/python2.7/lib-tk', '/usr/local/lib/python2.7/lib-old', '/usr/local/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/site-packages']

我发现只有当我在终端启动python时,才能导入那些模块!

ipython中的sys.path是

['',
 '/usr/bin',
 '/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-x86_64-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/gtk-2.0',
 '/usr/lib/pymodules/python2.7',
 '/usr/lib/python2.7/dist-packages/ubuntu-sso-client',
 '/usr/lib/python2.7/dist-packages/ubuntuone-client',
 '/usr/lib/python2.7/dist-packages/ubuntuone-control-panel',
 '/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol',
 '/usr/lib/python2.7/dist-packages/IPython/extensions']

但在我将这些路径添加到PYTHONPATH之后,它仍然无法正常工作。

ImportError: numpy/core/multiarray.so: undefined symbol: PyUnicodeUCS4_AsUnicodeEscapeString

那我怎么能覆盖pythonpath?

0 个答案:

没有答案