Matplotlib – ipython notebook – $DISPLAY variable error

ipythonipython-notebookmatplotlibtkinter

I am running IPython notebook on an ubuntu vm. Everything works great so far, except I'm unable to do interactive matplotlib plots.

The error I get is: 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/

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.

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.

However, interactivity only came available in the latest release of matplotlib (1.4.x) and so I needed to upgrade from 1.3.x.

After running sudo pip install matplotlib --upgrade I got the following error in my .pip_log.

Any advice?

----------------------------------------
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

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

Best Answer

Run this before

%matplotlib inline
Related Topic