new matplotlib tcl problem

83 views
Skip to first unread message

Marian Siwiak

unread,
Jul 16, 2013, 3:21:51 PM7/16/13
to web...@googlegroups.com
Hi,

I try to run a module starting with:

def mymodule(variables):
    import matplotlib
    matplotlib.use('Agg')
    from pymol import *

When I call it, I get error - piece of traceback is included below.

File "/usr/lib/pymodules/python2.7/matplotlib/pyplot.py", line 343, in figure
**kwargs)
File "/usr/lib/pymodules/python2.7/matplotlib/backends/backend_tkagg.py", line 80, in new_figure_manager
window = Tk.Tk()
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1712, in __init__
self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
TclError: no display name and no $DISPLAY environment variable

Google says this tclerror usually means that tk tries to get interactive, but I thought matplotlib.use('Agg') should prevent that.
Any advice?
Thanks in advance.

Massimo Di Pierro

unread,
Jul 17, 2013, 5:06:20 AM7/17/13
to web...@googlegroups.com
Based on this: github.com/web2py/web2py
you are right

Marian Siwiak

unread,
Jul 17, 2013, 5:54:21 AM7/17/13
to web...@googlegroups.com
Solved. 
Explanation below is for future reference, if someone will experience similar problem (as Massimo pointed it in a very gentle way, maybe not that obvious to an external reader, and this solution is applicable I guess to a very wide range of problems). 
Solution: It is always worth updating web2py to a newest version. 
I was a bit afraid it may screw something with my app, but I was SOOOO wrong!
Problem existed in version 1.99 and magically (yeach, sure!) disappeared in 2.5.1.
Thanks,
Marian
TAG: library problem, compatibility issues, environment variables, external library, matplotlib  


--
 
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/bNsGtWbV7AU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Marian Siwiak

unread,
Feb 19, 2014, 7:45:20 PM2/19/14
to web...@googlegroups.com
Ekhm. In a version 2.8 we go back to the very same problem from 1.99.
Did I miss something in matplotlib handling? search of the group didn't come with anything useful... there is a discussion on setting MPLCONFIGDIR setting to some tmp dir, but hey, in 2.5.1 everything works smoothly without it.

Very best regards,


On Wednesday, 17 July 2013 10:54:21 UTC+1, Marian Siwiak wrote:
Solved. 
Explanation below is for future reference, if someone will experience similar problem (as Massimo pointed it in a very gentle way, maybe not that obvious to an external reader, and this solution is applicable I guess to a very wide range of problems). 
Solution: It is always worth updating web2py to a newest version. 
I was a bit afraid it may screw something with my app, but I was SOOOO wrong!
Problem existed in version 1.99 and magically (yeach, sure!) disappeared in 2.5.1.
Thanks,
Marian
TAG: library problem, compatibility issues, environment variables, external library, matplotlib  
To unsubscribe from this group and all its topics, send an email to web2py+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages