得到“libatk-1.0.so.0:未定义符号";当我在 Ubuntu 13.10 中尝试 ipython --pylab 时 [英] got "libatk-1.0.so.0: undefined symbol" when I tried ipython --pylab in Ubuntu 13.10

查看:518
本文介绍了得到“libatk-1.0.so.0:未定义符号";当我在 Ubuntu 13.10 中尝试 ipython --pylab 时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我当前正在使用Ubuntu 13.10,并应用了所有系统更新.我已经安装了Enthought顶篷(版本:1.1.1.1452).而今天,当我试图绘制时,我一无所获.谷歌搜索后,我在命令行中运行了ipython --pylab",但收到以下消息:

I am currently using Ubuntu 13.10 and applied all the system updates. I have installed the Enthought Canopy (Version: 1.1.1.1452). And today when I tried to plot, I got nothing. After googling, I have run 'ipython --pylab' in command line but got the following message:

Matplotlib backend_wx and backend_wxagg require wxPython >=2.8

我可以进入交互式 ipython shell,但我仍然无法绘图.

I could get into the interactive ipython shell but I still couldn't plot.

然后我按照用户论坛中的提示进行操作,并尝试导入wx"并得到:

Then I follow the tips from user forum and I tried 'import wx' and got:

/usr/lib/x86_64-linux-gnu/libatk-1.0.so.0: undefined symbol: g_type_class_adjust_private_offset

由于我前一段时间可以使用Canopy的绘图功能,所以我怀疑Ubuntu的系统更新会在某种程度上引起与当前Canopy的库冲突.

Since I was able to use Canopy's plotting functionality a while ago, I suspect that Ubuntu's system update somehow introduces some library conflict with the current Canopy.

有人提示我解决这个问题吗?非常感谢大家!!

Anybody has a hint for me to solve this please? Thank you all very much!!

推荐答案

同样的问题,同样的系统(Ubuntu 13.10,Canopy 1.1.1.1452),这对我有用.根据 this 帖子,问题是 wxPython机盖:

Same problem, same system (Ubuntu 13.10, Canopy 1.1.1.1452), this is what worked for me. According to this post, the problem is wxPython and Canopy:

我们建议那些没有大型wx专用代码库的用户使用Qt后端而不是wx."

"We recommend that users who do not have a large wx-specific code base use the Qt backend rather than wx."

以下是您可以如何专门用于让 matplotlib 与 Qt 一起工作(并解决您的问题).要找出哪个是您当前的后端,请通过以下方式使用 matplotlib.get_backend():

Here's how you can do that specifically for getting matplotlib to work with Qt (and solve your problem). To find out which is your current backend use matplotlib.get_backend() by:

>>> import matplotlib
>>> matplotlib.get_backend()
'WXAgg'

如果您看到上述 "WXAgg"设置 matplotlib 后端使用 matplotlib.use()作为以下已知后端之一:

If you are seeing "WXAgg" like above, set the matplotlib backend to one of the known backends using matplotlib.use() as:

import matplotlib
matplotlib.use('QT4Agg')  

您可以在脚本中添加上述内容,或者在初始化 python 会话时,pyplotpylab 等将加载而不会出错,例如:

You can add the above in your script, or upon initializing a python session, and pyplot, pylab etc. would load without an error, for example:

import pylab  
from matplotlib import pylab                                       
from matplotlib import pyplot

更新:

自动配置后端的一种简便方法是编辑 matplotlibrc 配置文件.对于 Canopy,文件位于

A convenient way to configure the backend automatically is to edit the matplotlibrc configuration file. For Canopy the file is located in

~/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/matplotlib/mpl-data

matplotlibrc 中,替换以下行:

backend      : WXAgg

具有:

backend      : Qt4Agg

这篇关于得到“libatk-1.0.so.0:未定义符号";当我在 Ubuntu 13.10 中尝试 ipython --pylab 时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆