4

I am running a Docker container with Jupyter Notebook using:

sudo nvidia-docker run -it -v /media/files:/files -p 8888:8888 -p 6001:6001 mybigdocker:latest

And then connecting to it at 127.0.0.1:8888 in Chrome.

Everything works fine, except if I try to do anything with matplotlib, or any type of non-text output, where I get the error:

TclError: no display name and no $DISPLAY environment variable

I have tried adding --env="DISPLAY" and --env=$DISPLAY and --env=":0" with no avail.

How do I fix this?

user1566200
  • 1,826
  • 4
  • 27
  • 47
  • http://stackoverflow.com/questions/2801882/generating-a-png-with-matplotlib-when-display-is-undefined That answer should help but what I think you need to do is `import matplotlib # Force matplotlib to not use any Xwindows backend. matplotlib.use('Agg')` – Ali Aug 18 '16 at 23:31
  • @Alastair looks like I still get the same problem when I run it in ipython notebook; but seems to work OK in console ipython. – user1566200 Aug 18 '16 at 23:47

0 Answers0