Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Travis error: _tkinter.TclError: no display name and no $DISPLAY environment variable #2

Closed
sylhare opened this issue Apr 15, 2017 · 1 comment
Assignees
Labels

Comments

@sylhare
Copy link
Owner

sylhare commented Apr 15, 2017

Travis pops up this error when trying to run p.sacksplot():
_tkinter.TclError: no display name and no $DISPLAY environment variable

It seems it is related to the line using matplotlib:
plt.figure()

@sylhare sylhare added the bug label Apr 15, 2017
sylhare added a commit that referenced this issue Apr 15, 2017
For travis bug and matplot lib, issue #2
@sylhare sylhare self-assigned this Apr 15, 2017
@sylhare
Copy link
Owner Author

sylhare commented Apr 15, 2017

You can find the answer at stackoverflow/tkinter-tclerror-no-display-name-and-no-display-environment-variable

I used this answer to set the backend of matloblib before pyplot is loaded from here

import os
import matplotlib as mpl
if os.environ.get('DISPLAY','') == '':
   print('no display found. Using non-interactive Agg backend')
   mpl.use('Agg')
import matplotlib.pyplot as plt

For some more information on this issue:

@sylhare sylhare closed this as completed Apr 15, 2017
sylhare added a commit that referenced this issue Apr 30, 2017
lukas-stelzl added a commit to bio-phys/PyDHAMed that referenced this issue Nov 30, 2017
sylhare/nprime#2 Get tests plot to work on Travis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant