Re: [Matplotlib-users] PDF backend errors out; PNG works fine

2009-07-22 Thread John Kerenyi
Thank you for your response. Your response made me wonder how the script would 
operate in a non-graphic environment--I had tested it on a login node but not 
on a computing node. It appears that even though I have no need for any graphic 
display, the modules I am loading expect to have it nonetheless. I invoke 
matplotlib using the standard "import matplotlib.pyplot as plt" line. Here is 
the output when run on a compute node:

-

[ac.jkere...@n123 pygraph]$ ./run_pygraph.py png
Creating Top 100 V/C ratios graph...
Traceback (most recent call last):
  File "./run_pygraph.py", line 566, in 
GraphTop100VC (Top100VCFilename)
  File "./run_pygraph.py", line 326, in GraphTop100VC
fig=plt.figure()
  File "/soft/python/lib/python2.6/site-packages/matplotlib/pyplot.py", line 
251, in figure
**kwargs)
  File 
"/soft/python/lib/python2.6/site-packages/matplotlib/backends/backend_tkagg.py",
 line 90, in new_figure_manager
window = Tk.Tk()
  File "/soft/python/lib/python2.6/lib-tk/Tkinter.py", line 1643, in __init__
self.tk = _tkinter.create(screenName, baseName, className, interactive, 
wantobjects, useTk, sync, use)
_tkinter.TclError: no display name and no $DISPLAY environment variable

-

Can anyone advise if there another way to invoke matplotlib that does not 
require graphic support?

With respect to your suggestion that I run python setup.py build, I don't seem 
to have the necessary permissions but the sysadmin is very helpful and once I 
have a little more information on the new problem I'll get his help again.

Thanks again,

John Kerenyi

-Original Message-
From: Jouni K. Seppänen [mailto:j...@iki.fi] 
Sent: Wednesday, July 22, 2009 9:38 AM
To: matplotlib-users@lists.sourceforge.net
Subject: Re: [Matplotlib-users] PDF backend errors out; PNG works fine

"John Kerenyi"  writes:

>   File
> "/soft/python/lib/python2.6/site-packages/matplotlib/backends/backend_
> pd
> f.py", line 44, in 
> from matplotlib import ttconv
> ImportError:
> /soft/python/lib/python2.6/site-packages/matplotlib/ttconv.so: 
> undefined
> symbol: _ZTVSt19basic_ostringstreamIcSt11char_traitsIcESaIcEE

Sounds like a mismatch between C++ libraries on the system where matplotlib was 
built and where it is being used. You mentioned a cluster; perhaps your 
sysadmin compiled matplotlib on a special node that has more libraries 
installed than the computation nodes. I don't know how to fix this, but as a 
first step you could try compiling matplotlib on a computation node (submit 
something like "python setup.py build" as a job the same way you would submit 
another task on the
cluster) and seeing if that gives more clues about what is missing.

--
Jouni K. Seppänen
http://www.iki.fi/jks


--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] PDF backend errors out; PNG works fine

2009-07-22 Thread John Kerenyi
Hello all,
 
I am a relatively new user of matplotlib but have come a long way in
these last couple months. I developed some Python graph scripts on my
Windows machine, which reports matplotlib version 0.98.5.2 (installed
via Python(x,y)). These scripts write either .png or .pdf files,
depending on how called; and they work fine in this environment.
 
Now that my scripts are suitable for running unattended, I've asked a
Linux system administrator to install matplotlib on a Linux cluster
which I use for my main application, and he did so from source. The
version that is reported is 0.98.5.3.
 
When I run the script in the Linux environment, png files are written as
intended, with no errors, but attempting to create pdf graphs generates
the following error for the first occurrence of savefig:
 
---
 
[ac.jkere...@l01 pygraph]$ ./run_pygraph.py pdf
Creating Top 100 V/C ratios graph...
MaxVCRatios.pdf
Traceback (most recent call last):
  File "./run_pygraph.py", line 566, in 
GraphTop100VC (Top100VCFilename)
  File "./run_pygraph.py", line 369, in GraphTop100VC
fig.savefig("MaxVCRatios"+OutputImageType,format="pdf")
  File "/soft/python/lib/python2.6/site-packages/matplotlib/figure.py",
line 990, in savefig
self.canvas.print_figure(*args, **kwargs)
  File
"/soft/python/lib/python2.6/site-packages/matplotlib/backend_bases.py",
line 1419, in print_figure
**kwargs)
  File
"/soft/python/lib/python2.6/site-packages/matplotlib/backend_bases.py",
line 1311, in print_pdf
from backends.backend_pdf import FigureCanvasPdf # lazy import
  File
"/soft/python/lib/python2.6/site-packages/matplotlib/backends/backend_pd
f.py", line 44, in 
from matplotlib import ttconv
ImportError:
/soft/python/lib/python2.6/site-packages/matplotlib/ttconv.so: undefined
symbol: _ZTVSt19basic_ostringstreamIcSt11char_traitsIcESaIcEE

-
 
The expression "MaxVCRatios"+OutputImageType resolves to the string
"MaxVCRatios.pdf" (confirmed by the second output line of the script,
which was printed for testing purposes). I played with providing or
omitting the format="pdf" parameter and it made no difference. I've also
searched for others with a similar issue and found none so I'm posting
to this list to see if anyone can help. I need to know if this is a
problem with my script, or if it's something the system administrator
needs to fix. Let me know if there's any additional information you
would like me to provide.
 
Thanks,
 
John K.
 
John Kerenyi, P.E. 
Senior Traffic Engineer 
City of Moreno Valley 
14177 Frederick Street
P.O. Box 88005
Moreno Valley, CA  92552-0805
(951) 413-3199
(951) 413-3141 fax 
jo...@moval.org
 
--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users