我刚刚安装了 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配置有什么问题吗?
我的蟒蛇路径是
['', '/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?