问题描述
我正在ubuntu vm上运行IPython Notebook.到目前为止,一切工作正常,但我无法进行交互式matplotlib图.
I am running IPython notebook on an ubuntu vm. Everything works great so far, except I'm unable to do interactive matplotlib plots.
我得到的错误是:TclError: no display name and no $DISPLAY environment variable
我只是想遵循这些超级基础教程.
And I'm just trying to follow these super basic tutorials.
http://nbviewer.ipython.org/github/jakevdp/matplotlib_pydata2013/tree/master/notebooks/
有什么秘诀吗?我已经做过一些研究,但似乎没有什么适用于从ubuntu机器运行iPython的方法.我知道我忽略了一些显而易见的事情.
Any tips? I've done some research but nothing seems applicable to running iPython from an ubuntu machine. I know I'm overlooking something obvious.
在与ThomasK谈完此事之后,看来我需要在iPython中从%matplotlib inline
跟随%matplotlib nbaggs
运行,以从我的VM中获得交互性.
After speaking with ThomasK about this, it seems I need to run %matplotlib nbaggs
following %matplotlib inline
from within iPython to get the interactivity from within my VM.
但是,交互性仅在最新版本的matplotlib(1.4.x)中可用,因此我需要从1.3.x升级.
However, interactivity only came available in the latest release of matplotlib (1.4.x) and so I needed to upgrade from 1.3.x.
运行sudo pip install matplotlib --upgrade
后,我的.pip_log中出现以下错误.
After running sudo pip install matplotlib --upgrade
I got the following error in my .pip_log.
有什么建议吗?
----------------------------------------
Cleaning up...
Removing temporary dir /tmp/pip_build_root...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/matplotlib
Exception information:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 278, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1229, in prepare_files
req_to_install.run_egg_info()
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 325, in run_egg_info
command_desc='python setup.py egg_info')
File "/usr/lib/python2.7/dist-packages/pip/util.py", line 697, in call_subprocess
% (command_desc, proc.returncode, cwd))
InstallationError: Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/matplotlib
请在此处查看更多更好的问题:运行与Nbagg交互的matplotlib的linux VM上的ipython笔记本
PLEASE SEE HERE FOR A MUCH BETTER QUESTION: ipython notebook on linux VM running matplotlib interactive with nbagg
推荐答案
请先运行
%matplotlib inline
这篇关于ipython notebook-$ DISPLAY变量错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!