我已经在一台远程MacOS10.8.5机器上安装了Anaconda,我正在尝试将matplotlib图形转发回我的本地计算机,但是IPython一直试图使用远程机器的本地图形并崩溃。还有其他人经历过吗?我可以用旧的Enthought分发(EPD)来完成这个任务,所以我知道所涉及的机器都是为它设置的。
我问过这个问题,其他地方,但没有运气。谢谢你的帮助。
localmachine:~ me$ ssh -Y remotemachine
Password:
Last login: Fri Sep 12 10:46:08 2014 from localmachine
remotemachine:~ me$ ipython
Python 2.7.8 |Anaconda 2.0.1 (x86_64)| (default, Aug 21 2014, 15:21:46)
Type "copyright", "credits" or "license" for more information.
IPython 2.2.0 -- An enhanced Interactive Python.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://binstar.org
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: import matplotlib
In [2]: import matplotlib.pyplot as plt
In [3]: plt.rcParams['backend']
Out[3]: 'TkAgg'
In [4]: matplotlib.use('TkAgg')
In [5]: plt.plot([1,2],[3,4])
_RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.
CGColor with 0 components
/Users/me/anaconda/bin/python.app: line 3: 80244 Abort trap: 6 /Users/me/anaconda/python.app/Contents/MacOS/python "$@"发布于 2014-09-17 18:57:00
从Anaconda2.0开始,Continuum 停止与X11链接tk转而链接到Cocoa,这使得转发网络图形的尝试使解释器崩溃。当我将tk降级到链接到TkAgg的最后一个版本时,使用X11后端的交互式matplotlib的网络转发再次工作:
conda install tk=8.5.13缺点是,现在我不能再升级/安装任何试图更新tk的内容。另外,Qt4Agg交互式后端仍然会使解释器崩溃。我想这是向前迈出的一步。
编辑:我看到,您可以在一个特定版本的封装,描述这里。
https://stackoverflow.com/questions/25874998
复制相似问题