ipython notebook - $ DISPLAY变量错误

时间:2014-11-10 22:33:39

标签: matplotlib tkinter ipython ipython-notebook

我在ubuntu vm上运行IPython笔记本。到目前为止,一切都很好,除了我无法做交互式matplotlib情节。

我得到的错误是:TclError: no display name and no $DISPLAY environment variable

我只是想尝试遵循这些超级基础教程。

http://nbviewer.ipython.org/github/jakevdp/matplotlib_pydata2013/tree/master/notebooks/

任何提示?我做过一些研究,但似乎没有什么适用于从ubuntu机器上运行iPython。我知道我忽略了一些显而易见的事情。

在与ThomasK谈论此事后,似乎我需要在iPython中运行%matplotlib nbaggs %matplotlib inline以从我的VM中获取交互性。

但是,只有matplotlib(1.4.x)的最新版本才提供交互功能,所以我需要从1.3.x升级。

运行sudo pip install matplotlib --upgrade后,我的.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

请在此处查看更好的问题:ipython notebook on linux VM running matplotlib interactive with nbagg

1 个答案:

答案 0 :(得分:16)

之前运行
%matplotlib inline