ipython notebook - $DISPLAY 变量错误 [英] ipython notebook - $DISPLAY variable error

查看:27
本文介绍了ipython notebook - $DISPLAY 变量错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 ubuntu 虚拟机上运行 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

请在此处查看更好的问题:运行 matplotlib 的 Linux VM 上的 ipython notebook 与 nbagg 交互

PLEASE SEE HERE FOR A MUCH BETTER QUESTION: ipython notebook on linux VM running matplotlib interactive with nbagg

推荐答案

在此之前运行

%matplotlib inline

这篇关于ipython notebook - $DISPLAY 变量错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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