【问题标题】:got "libatk-1.0.so.0: undefined symbol" when I tried ipython --pylab in Ubuntu 13.10当我在 Ubuntu 13.10 中尝试 ipython --pylab 时得到“libatk-1.0.so.0: undefined symbol”
【发布时间】:2013-11-13 14:41:35
【问题描述】:

我目前使用的是 Ubuntu 13.10 并应用了所有系统更新。我已经安装了 Enthought Canopy(版本:1.1.1.1452)。而今天,当我试图策划时,我什么也没得到。谷歌搜索后,我在命令行中运行了 'ipython --pylab' 但收到以下消息:

Matplotlib backend_wx and backend_wxagg require wxPython >=2.8

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

然后我按照用户论坛的提示尝试'import wx'并得到:

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

由于我不久前能够使用 Canopy 的绘图功能,我怀疑 Ubuntu 的系统更新以某种方式引入了与当前 Canopy 的一些库冲突。

请有人给我一个提示来解决这个问题?非常感谢大家!!

【问题讨论】:

    标签: ubuntu matplotlib wxpython enthought canopy


    【解决方案1】:

    同样的问题,同样的系统(Ubuntu 13.10,Canopy 1.1.1.1452),这对我有用。根据this的帖子,问题是wxPythonCanopy

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

    以下是专门为使matplotlib 与 Qt 一起工作(并解决您的问题)的方法。要找出您当前的后端,请使用matplotlib.get_backend() by:

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

    如果您看到"WXAgg" 如上所述,set the matplotlib backend 使用matplotlib.use() 作为已知后端之一:

    import matplotlib
    matplotlib.use('QT4Agg')  
    

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

    import pylab  
    from matplotlib import pylab                                       
    from matplotlib import pyplot
    

    更新

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

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

    matplotlibrc中,替换行:

    backend      : WXAgg
    

    与:

    backend      : Qt4Agg
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-04-17
      • 2018-01-16
      • 2020-03-10
      • 2017-11-06
      • 2022-10-04
      相关资源
      最近更新 更多