Chaco plot to PDF

classic Classic list List threaded Threaded
29 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Chaco plot to PDF

Jim Radke

Hi,

 

I am trying to use Kiva to create a PDF from a Chaco plot.  I would like to be able to run a script on a Linux server that does not have a display connected to it.  I am testing the noninteractive.py example and it works on a box with an XDisplay connected but not when there is not display.   Is there a way to generate a plotcontainer with a plot, and generate a PDF on a headless Linux server  ? 

 

We like to run scripts on headless servers that generate various PDF files, so if this is possible the next question is where do I find documentation on how to configure the PDF output ?  I have found very little documentation so far.  Actually we’d like to build various analysis scripts that generate detailed PDF files with metrics, commentary and plots and run these on servers.  Is this possible with the Kiva PDF package ?

 

Thanks

Jim Radke

[hidden email]

Getco LLC



This e-mail and its attachments are intended only for the individual or entity to whom it is addressed and may contain information that is confidential, privileged, inside information, or subject to other restrictions on use or disclosure. Any unauthorized use, dissemination or copying of this transmission or the information in it is prohibited and may be unlawful. If you have received this transmission in error, please notify the sender immediately by return e-mail, and permanently delete or destroy this e-mail, any attachments, and all copies (digital or paper). Unless expressly stated in this e-mail, nothing in this message should be construed as a digital or electronic signature.

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Chaco plot to PDF

Peter Wang
On Thu, Nov 11, 2010 at 2:05 PM, Jim Radke <[hidden email]> wrote:
> I am trying to use Kiva to create a PDF from a Chaco plot.  I would like to
> be able to run a script on a Linux server that does not have a display
> connected to it.  I am testing the noninteractive.py example and it works on
> a box with an XDisplay connected but not when there is not display.   Is
> there a way to generate a plotcontainer with a plot, and generate a PDF on a
> headless Linux server  ?

There should be.  However, I believe that if you have the wx libraries
installed, it may attempt to connect, and when it fails, instead of
continuing on, it gets dies somewhere inside wxWindows when wx tries
to connect to the display.  Can you send the exact error message that
you see when you don't have a $DISPLAY set?

> We like to run scripts on headless servers that generate various PDF files,
> so if this is possible the next question is where do I find documentation on
> how to configure the PDF output ?  I have found very little documentation so
> far.  Actually we’d like to build various analysis scripts that generate
> detailed PDF files with metrics, commentary and plots and run these on
> servers.  Is this possible with the Kiva PDF package ?

Kiva's PDF support is still pretty rudimentary.  The text transform
handling needs to be fixed, and I have someone slated to look at that,
but he is currently looking at a different issue.  Ultimately, Kiva
just uses Reportlab, so it's possible that you can use Reportlab to do
the bulk of the report generation, then pass the PDF into Kiva and
have it render the plot.

There is not a lot of configuration available on the PDF output,
mostly because we haven't really had much in the way of user feature
requests, either on the open source side or the customer-facing side.
Since Reportlab is pretty straightforward to use, I think most of
these sorts of features wouldn't be that hard to implement.

If you need to have something working right right now, then what we
can do is generate a PNG at a higher resolution (usually 300dpi
instead of 72dpi) and then embed that as a raster into the PDF.
Obviously this is not ideal if space/size is a concern, but it would
be a stopgap measure until the PDF backend was improved.


-Peter
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Chaco plot to PDF

Jim Radke
This is the error I get....

“Unable to access the X Display, is $DISPLAY set properly?”

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Peter Wang
Sent: Friday, November 12, 2010 4:00 PM
To: [hidden email]
Subject: Re: [Enthought-Dev] Chaco plot to PDF

On Thu, Nov 11, 2010 at 2:05 PM, Jim Radke <[hidden email]> wrote:
> I am trying to use Kiva to create a PDF from a Chaco plot.  I would like to
> be able to run a script on a Linux server that does not have a display
> connected to it.  I am testing the noninteractive.py example and it works on
> a box with an XDisplay connected but not when there is not display.   Is
> there a way to generate a plotcontainer with a plot, and generate a PDF on a
> headless Linux server  ?

There should be.  However, I believe that if you have the wx libraries
installed, it may attempt to connect, and when it fails, instead of
continuing on, it gets dies somewhere inside wxWindows when wx tries
to connect to the display.  Can you send the exact error message that
you see when you don't have a $DISPLAY set?

> We like to run scripts on headless servers that generate various PDF files,
> so if this is possible the next question is where do I find documentation on
> how to configure the PDF output ?  I have found very little documentation so
> far.  Actually we’d like to build various analysis scripts that generate
> detailed PDF files with metrics, commentary and plots and run these on
> servers.  Is this possible with the Kiva PDF package ?

Kiva's PDF support is still pretty rudimentary.  The text transform
handling needs to be fixed, and I have someone slated to look at that,
but he is currently looking at a different issue.  Ultimately, Kiva
just uses Reportlab, so it's possible that you can use Reportlab to do
the bulk of the report generation, then pass the PDF into Kiva and
have it render the plot.

There is not a lot of configuration available on the PDF output,
mostly because we haven't really had much in the way of user feature
requests, either on the open source side or the customer-facing side.
Since Reportlab is pretty straightforward to use, I think most of
these sorts of features wouldn't be that hard to implement.

If you need to have something working right right now, then what we
can do is generate a PNG at a higher resolution (usually 300dpi
instead of 72dpi) and then embed that as a raster into the PDF.
Obviously this is not ideal if space/size is a concern, but it would
be a stopgap measure until the PDF backend was improved.


-Peter
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev

This e-mail and its attachments are intended only for the individual or entity to whom it is addressed and may contain information that is confidential, privileged, inside information, or subject to other restrictions on use or disclosure. Any unauthorized use, dissemination or copying of this transmission or the information in it is prohibited and may be unlawful. If you have received this transmission in error, please notify the sender immediately by return e-mail, and permanently delete or destroy this e-mail, any attachments, and all copies (digital or paper). Unless expressly stated in this e-mail, nothing in this message should be construed as a digital or electronic signature.
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Chaco plot to PDF

Peter Wang
On Fri, Nov 12, 2010 at 4:02 PM, Jim Radke <[hidden email]> wrote:
> This is the error I get....
>
> “Unable to access the X Display, is $DISPLAY set properly?”

OK.  Is wxPython installed on the system?  If so, can do try setting
the "KIVA_WISHLIST" environment variable to "pdf", and then trying
again?

-Peter
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Chaco plot to PDF

Jim Radke

KIVA_WISHLIST=pdf

nbq-qnt-app119$ python noninteractive.py
Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/Enable-3.3.1-py2.5-linux-x86_64.egg/enthought/kiva/__init__.py", line 68, in _try_backend
    globals()[key] = mod.__dict__[key]
KeyError: 'font_metrics_provider'
Traceback (most recent call last):
  File "non.py", line 17, in <module>
    from enthought.chaco.api import ArrayPlotData, Plot, PlotGraphicsContext
  File "/usr/lib/python2.5/site-packages/Chaco-3.3.1-py2.5-linux-x86_64.egg/enthought/chaco/api.py", line 36, in <module>
    from abstract_plot_renderer import AbstractPlotRenderer
  File "/usr/lib/python2.5/site-packages/Chaco-3.3.1-py2.5-linux-x86_64.egg/enthought/chaco/abstract_plot_renderer.py", line 7, in <module>
    from plot_component import PlotComponent
  File "/usr/lib/python2.5/site-packages/Chaco-3.3.1-py2.5-linux-x86_64.egg/enthought/chaco/plot_component.py", line 4, in <module>
    from enthought.enable.api import Component
  File "/usr/lib/python2.5/site-packages/Enable-3.3.1-py2.5-linux-x86_64.egg/enthought/enable/api.py", line 8, in <module>
    from base import IDroppedOnHandler, TOP, VCENTER, BOTTOM, LEFT, HCENTER, RIGHT, \
  File "/usr/lib/python2.5/site-packages/Enable-3.3.1-py2.5-linux-x86_64.egg/enthought/enable/base.py", line 36, in <module>
    from enthought.kiva import font_metrics_provider
  File "/usr/lib/python2.5/site-packages/Enable-3.3.1-py2.5-linux-x86_64.egg/enthought/kiva/__init__.py", line 118, in <module>
    _backend_passthrough()
  File "/usr/lib/python2.5/site-packages/Enable-3.3.1-py2.5-linux-x86_64.egg/enthought/kiva/__init__.py", line 100, in _backend_passthrough
    raise RuntimeError, "no usable backend found"
RuntimeError: no usable backend found


-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Peter Wang
Sent: Friday, November 12, 2010 4:05 PM
To: [hidden email]
Subject: Re: [Enthought-Dev] Chaco plot to PDF

On Fri, Nov 12, 2010 at 4:02 PM, Jim Radke <[hidden email]> wrote:
> This is the error I get....
>
> “Unable to access the X Display, is $DISPLAY set properly?”

OK.  Is wxPython installed on the system?  If so, can do try setting
the "KIVA_WISHLIST" environment variable to "pdf", and then trying
again?

-Peter
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev

This e-mail and its attachments are intended only for the individual or entity to whom it is addressed and may contain information that is confidential, privileged, inside information, or subject to other restrictions on use or disclosure. Any unauthorized use, dissemination or copying of this transmission or the information in it is prohibited and may be unlawful. If you have received this transmission in error, please notify the sender immediately by return e-mail, and permanently delete or destroy this e-mail, any attachments, and all copies (digital or paper). Unless expressly stated in this e-mail, nothing in this message should be construed as a digital or electronic signature.
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Chaco plot to PDF

Anthony Scopatz
In reply to this post by Jim Radke
Hello Jim, 

This seems to me like an X windows error, not a Kiva one.  If you are headless, do you even have X windows installed?  If so, is it running?

My guess is that Kiva can't render because it doesn't know where to render to (the environmental variable DISPLAY is not set right).  Obscure commands like 'xset', 'xsetmode', 'xhost' might help you figure this out.  

I recall I had a similar issue about a year ago, but I am not finding the solution easily...  I'll keep looking though.

Be Well
Anthony  

On Fri, Nov 12, 2010 at 4:02 PM, Jim Radke <[hidden email]> wrote:
This is the error I get....

“Unable to access the X Display, is $DISPLAY set properly?”

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Peter Wang
Sent: Friday, November 12, 2010 4:00 PM
To: [hidden email]
Subject: Re: [Enthought-Dev] Chaco plot to PDF

On Thu, Nov 11, 2010 at 2:05 PM, Jim Radke <[hidden email]> wrote:
> I am trying to use Kiva to create a PDF from a Chaco plot.  I would like to
> be able to run a script on a Linux server that does not have a display
> connected to it.  I am testing the noninteractive.py example and it works on
> a box with an XDisplay connected but not when there is not display.   Is
> there a way to generate a plotcontainer with a plot, and generate a PDF on a
> headless Linux server  ?

There should be.  However, I believe that if you have the wx libraries
installed, it may attempt to connect, and when it fails, instead of
continuing on, it gets dies somewhere inside wxWindows when wx tries
to connect to the display.  Can you send the exact error message that
you see when you don't have a $DISPLAY set?

> We like to run scripts on headless servers that generate various PDF files,
> so if this is possible the next question is where do I find documentation on
> how to configure the PDF output ?  I have found very little documentation so
> far.  Actually we’d like to build various analysis scripts that generate
> detailed PDF files with metrics, commentary and plots and run these on
> servers.  Is this possible with the Kiva PDF package ?

Kiva's PDF support is still pretty rudimentary.  The text transform
handling needs to be fixed, and I have someone slated to look at that,
but he is currently looking at a different issue.  Ultimately, Kiva
just uses Reportlab, so it's possible that you can use Reportlab to do
the bulk of the report generation, then pass the PDF into Kiva and
have it render the plot.

There is not a lot of configuration available on the PDF output,
mostly because we haven't really had much in the way of user feature
requests, either on the open source side or the customer-facing side.
Since Reportlab is pretty straightforward to use, I think most of
these sorts of features wouldn't be that hard to implement.

If you need to have something working right right now, then what we
can do is generate a PNG at a higher resolution (usually 300dpi
instead of 72dpi) and then embed that as a raster into the PDF.
Obviously this is not ideal if space/size is a concern, but it would
be a stopgap measure until the PDF backend was improved.


-Peter
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev

This e-mail and its attachments are intended only for the individual or entity to whom it is addressed and may contain information that is confidential, privileged, inside information, or subject to other restrictions on use or disclosure. Any unauthorized use, dissemination or copying of this transmission or the information in it is prohibited and may be unlawful. If you have received this transmission in error, please notify the sender immediately by return e-mail, and permanently delete or destroy this e-mail, any attachments, and all copies (digital or paper). Unless expressly stated in this e-mail, nothing in this message should be construed as a digital or electronic signature.
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev


_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Chaco plot to PDF

Robert Kern
On Fri, Nov 12, 2010 at 4:13 PM, Anthony Scopatz <[hidden email]> wrote:
> Hello Jim,
> This seems to me like an X windows error, not a Kiva one.  If you are
> headless, do you even have X windows installed?  If so, is it running?
> My guess is that Kiva can't render because it doesn't know where to render
> to (the environmental variable DISPLAY is not set right).  Obscure commands
> like 'xset', 'xsetmode', 'xhost' might help you figure this out.
> I recall I had a similar issue about a year ago, but I am not finding the
> solution easily...  I'll keep looking though.

By "headless", he means that he needs to run it without X. Rendering
to PDF should not require X.

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
  -- Umberto Eco
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Chaco plot to PDF

Jim Radke
Yes, thank you.  Just as we can with matplotlib, we would like to create a PNG or preferably a PDF using our server farm, which does not run X.

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Robert Kern
Sent: Friday, November 12, 2010 4:17 PM
To: [hidden email]
Subject: Re: [Enthought-Dev] Chaco plot to PDF

On Fri, Nov 12, 2010 at 4:13 PM, Anthony Scopatz <[hidden email]> wrote:
> Hello Jim,
> This seems to me like an X windows error, not a Kiva one.  If you are
> headless, do you even have X windows installed?  If so, is it running?
> My guess is that Kiva can't render because it doesn't know where to render
> to (the environmental variable DISPLAY is not set right).  Obscure commands
> like 'xset', 'xsetmode', 'xhost' might help you figure this out.
> I recall I had a similar issue about a year ago, but I am not finding the
> solution easily...  I'll keep looking though.

By "headless", he means that he needs to run it without X. Rendering
to PDF should not require X.

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
  -- Umberto Eco
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev

This e-mail and its attachments are intended only for the individual or entity to whom it is addressed and may contain information that is confidential, privileged, inside information, or subject to other restrictions on use or disclosure. Any unauthorized use, dissemination or copying of this transmission or the information in it is prohibited and may be unlawful. If you have received this transmission in error, please notify the sender immediately by return e-mail, and permanently delete or destroy this e-mail, any attachments, and all copies (digital or paper). Unless expressly stated in this e-mail, nothing in this message should be construed as a digital or electronic signature.
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Chaco plot to PDF

Anthony Scopatz
I misread your initial statement 

it works on a box with an XDisplay connected but not when there is not display.   Is there a way to generate a plotcontainer with a plot, and generate a PDF on a headless Linux server  ?

to mean that X was installed but not running. 

All apologies.
Anthony

On Fri, Nov 12, 2010 at 4:24 PM, Jim Radke <[hidden email]> wrote:
Yes, thank you.  Just as we can with matplotlib, we would like to create a PNG or preferably a PDF using our server farm, which does not run X.

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Robert Kern
Sent: Friday, November 12, 2010 4:17 PM
To: [hidden email]
Subject: Re: [Enthought-Dev] Chaco plot to PDF

On Fri, Nov 12, 2010 at 4:13 PM, Anthony Scopatz <[hidden email]> wrote:
> Hello Jim,
> This seems to me like an X windows error, not a Kiva one.  If you are
> headless, do you even have X windows installed?  If so, is it running?
> My guess is that Kiva can't render because it doesn't know where to render
> to (the environmental variable DISPLAY is not set right).  Obscure commands
> like 'xset', 'xsetmode', 'xhost' might help you figure this out.
> I recall I had a similar issue about a year ago, but I am not finding the
> solution easily...  I'll keep looking though.

By "headless", he means that he needs to run it without X. Rendering
to PDF should not require X.

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
 -- Umberto Eco
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev

This e-mail and its attachments are intended only for the individual or entity to whom it is addressed and may contain information that is confidential, privileged, inside information, or subject to other restrictions on use or disclosure. Any unauthorized use, dissemination or copying of this transmission or the information in it is prohibited and may be unlawful. If you have received this transmission in error, please notify the sender immediately by return e-mail, and permanently delete or destroy this e-mail, any attachments, and all copies (digital or paper). Unless expressly stated in this e-mail, nothing in this message should be construed as a digital or electronic signature.
_______________________________________________


_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Chaco plot to PDF

Peter Wang
In reply to this post by Jim Radke
So, the backend_pdf.py in Kiva definitely needs some fixups, but the
core basically works.  Please use the attached backend_pdf.py, by
replacing the one in your enthought/kiva/ directory.


-Peter

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev

backend_pdf.py (36K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Chaco plot to PDF

Jim Radke
Thanks,  I'll give it a try tomorrow.  Appreciate the help !


On Nov 12, 2010, at 4:38 PM, Peter Wang wrote:

> So, the backend_pdf.py in Kiva definitely needs some fixups, but the
> core basically works.  Please use the attached backend_pdf.py, by
> replacing the one in your enthought/kiva/ directory.
>
>
> -Peter
> <backend_pdf.py><ATT00001..txt>


This e-mail and its attachments are intended only for the individual or entity to whom it is addressed and may contain information that is confidential, privileged, inside information, or subject to other restrictions on use or disclosure. Any unauthorized use, dissemination or copying of this transmission or the information in it is prohibited and may be unlawful. If you have received this transmission in error, please notify the sender immediately by return e-mail, and permanently delete or destroy this e-mail, any attachments, and all copies (digital or paper). Unless expressly stated in this e-mail, nothing in this message should be construed as a digital or electronic signature.
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Chaco plot to PDF

Jim Radke
In reply to this post by Peter Wang
Ok, this did not solve the issue, I still this message...

"Unable to access the X Display, is $DISPLAY set properly?"

And just to be sure it was actually using the new backend_pdf.py file I renamed it and tried again and got an error saying it could not find the file.  Here are the diffs between the file you sent me and the one I had installed where backend_pdf.py.20101113 is the old version and backend_pdf.py is the version you sent.


nbq-qnt-app119$ diff backend_pdf.py backend_pdf.py.20101113
11d10
< # enthought/kiva/
59,60c58
< class CompiledPath(object):
<     pass
---
> CompiledPath = None
783,786d780
< def font_metrics_provider():
<     from backend_image import GraphicsContext as RasterGC
<     return RasterGC((1,1))
<

Any other ideas ?

Thanks
Jim

On Nov 12, 2010, at 4:38 PM, Peter Wang wrote:

> So, the backend_pdf.py in Kiva definitely needs some fixups, but the
> core basically works.  Please use the attached backend_pdf.py, by
> replacing the one in your enthought/kiva/ directory.
>
>
> -Peter
> <backend_pdf.py><ATT00001..txt>


This e-mail and its attachments are intended only for the individual or entity to whom it is addressed and may contain information that is confidential, privileged, inside information, or subject to other restrictions on use or disclosure. Any unauthorized use, dissemination or copying of this transmission or the information in it is prohibited and may be unlawful. If you have received this transmission in error, please notify the sender immediately by return e-mail, and permanently delete or destroy this e-mail, any attachments, and all copies (digital or paper). Unless expressly stated in this e-mail, nothing in this message should be construed as a digital or electronic signature.
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Chaco plot to PDF

Peter Wang
On Sat, Nov 13, 2010 at 7:58 AM, Jim Radke <[hidden email]> wrote:
> Ok, this did not solve the issue, I still this message...
>
> "Unable to access the X Display, is $DISPLAY set properly?"

Oh, I probably wasn't clear - you still need to set KIVA_WISHLIST=pdf.

> And just to be sure it was actually using the new backend_pdf.py file I renamed it and tried again and got an error saying it could not find the file.  Here are the diffs between the file you sent me and the one I had installed where backend_pdf.py.20101113 is the old version and backend_pdf.py is the version you sent.

That looks correct.
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Chaco plot to PDF

Jim Radke
Still no luck Peter.  I made sure I had the new version you sent.

EDITOR=vi
SECTOR_HOME=/opt/sector
LANG=en_US.UTF-8
KIVA_WISHLIST=pdf
SHLVL=1
HOME=/home/apprun
VTK_DATA_ROOT=/usr/global/vtk/VTKData
PYTHONPATH=.:/usr/global/vtk/lib/python2.5/site-packages:/home/apprun/tb309/bin:/home/apprun/tb309/python:/home/apprun
LOGNAME=apprun
CVS_RSH=ssh
SSH_CONNECTION=10.180.1.114 50494 10.124.150.134 22
LESSOPEN=|/usr/bin/lesspipe.sh %s
TRADER_REPOS=/home/apprun/workspace
G_BROKEN_FILENAMES=1
_=/bin/env
OLDPWD=/usr/lib/python2.5/site-packages/Enable-3.3.1-py2.5-linux-x86_64.egg/enthought/kiva

nbq-qnt-app119$ python noninteractive.py 
Unable to access the X Display, is $DISPLAY set properly?
nbq-qnt-app119$ 

On Nov 13, 2010, at 8:18 AM, Peter Wang wrote:

KIVA_WISHLIST=pd




This e-mail and its attachments are intended only for the individual or entity to whom it is addressed and may contain information that is confidential, privileged, inside information, or subject to other restrictions on use or disclosure. Any unauthorized use, dissemination or copying of this transmission or the information in it is prohibited and may be unlawful. If you have received this transmission in error, please notify the sender immediately by return e-mail, and permanently delete or destroy this e-mail, any attachments, and all copies (digital or paper). Unless expressly stated in this e-mail, nothing in this message should be construed as a digital or electronic signature.

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Chaco plot to PDF

bryce hendrix-2
Jim,

Try setting ETSConfig.enable_toolkit='null', that should stop the importing of wx. This has to be done prior to just about any other import though.

Bryce

On Sun, Nov 14, 2010 at 9:52 AM, Jim Radke <[hidden email]> wrote:
Still no luck Peter.  I made sure I had the new version you sent.

EDITOR=vi
SECTOR_HOME=/opt/sector
LANG=en_US.UTF-8
KIVA_WISHLIST=pdf
SHLVL=1
HOME=/home/apprun
VTK_DATA_ROOT=/usr/global/vtk/VTKData
PYTHONPATH=.:/usr/global/vtk/lib/python2.5/site-packages:/home/apprun/tb309/bin:/home/apprun/tb309/python:/home/apprun
LOGNAME=apprun
CVS_RSH=ssh
SSH_CONNECTION=10.180.1.114 50494 10.124.150.134 22
LESSOPEN=|/usr/bin/lesspipe.sh %s
TRADER_REPOS=/home/apprun/workspace
G_BROKEN_FILENAMES=1
_=/bin/env
OLDPWD=/usr/lib/python2.5/site-packages/Enable-3.3.1-py2.5-linux-x86_64.egg/enthought/kiva

nbq-qnt-app119$ python noninteractive.py 
Unable to access the X Display, is $DISPLAY set properly?
nbq-qnt-app119$ 

On Nov 13, 2010, at 8:18 AM, Peter Wang wrote:

KIVA_WISHLIST=pd




This e-mail and its attachments are intended only for the individual or entity to whom it is addressed and may contain information that is confidential, privileged, inside information, or subject to other restrictions on use or disclosure. Any unauthorized use, dissemination or copying of this transmission or the information in it is prohibited and may be unlawful. If you have received this transmission in error, please notify the sender immediately by return e-mail, and permanently delete or destroy this e-mail, any attachments, and all copies (digital or paper). Unless expressly stated in this e-mail, nothing in this message should be construed as a digital or electronic signature.

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev



_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Chaco plot to PDF

Jim Radke

Here are the imports in your noninteractive.py example, so where would I put that line ?

 

 

 

import os, sys

 

# Major library imports

from numpy import fabs, linspace, pi, sin

from scipy.special import jn

 

# Enthought library imports

from enthought.traits.api import false

 

# Chaco imports

from enthought.chaco.api import ArrayPlotData, Plot, PlotGraphicsContext

from enthought.chaco.example_support import COLOR_PALETTE

 

 

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of bryce hendrix
Sent: Monday, November 15, 2010 8:59 AM
To: [hidden email]
Subject: Re: [Enthought-Dev] Chaco plot to PDF

 

Jim,

 

Try setting ETSConfig.enable_toolkit='null', that should stop the importing of wx. This has to be done prior to just about any other import though.

 

Bryce

On Sun, Nov 14, 2010 at 9:52 AM, Jim Radke <[hidden email]> wrote:

Still no luck Peter.  I made sure I had the new version you sent.

 

EDITOR=vi

SECTOR_HOME=/opt/sector

LANG=en_US.UTF-8

KIVA_WISHLIST=pdf

SHLVL=1

HOME=/home/apprun

VTK_DATA_ROOT=/usr/global/vtk/VTKData

PYTHONPATH=.:/usr/global/vtk/lib/python2.5/site-packages:/home/apprun/tb309/bin:/home/apprun/tb309/python:/home/apprun

LOGNAME=apprun

CVS_RSH=ssh

SSH_CONNECTION=10.180.1.114 50494 10.124.150.134 22

LESSOPEN=|/usr/bin/lesspipe.sh %s

TRADER_REPOS=/home/apprun/workspace

G_BROKEN_FILENAMES=1

_=/bin/env

OLDPWD=/usr/lib/python2.5/site-packages/Enable-3.3.1-py2.5-linux-x86_64.egg/enthought/kiva

 

nbq-qnt-app119$ python noninteractive.py 

Unable to access the X Display, is $DISPLAY set properly?

nbq-qnt-app119$ 

 

On Nov 13, 2010, at 8:18 AM, Peter Wang wrote:



KIVA_WISHLIST=pd

 

 

 


This e-mail and its attachments are intended only for the individual or entity to whom it is addressed and may contain information that is confidential, privileged, inside information, or subject to other restrictions on use or disclosure. Any unauthorized use, dissemination or copying of this transmission or the information in it is prohibited and may be unlawful. If you have received this transmission in error, please notify the sender immediately by return e-mail, and permanently delete or destroy this e-mail, any attachments, and all copies (digital or paper). Unless expressly stated in this e-mail, nothing in this message should be construed as a digital or electronic signature.


_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev

 



This e-mail and its attachments are intended only for the individual or entity to whom it is addressed and may contain information that is confidential, privileged, inside information, or subject to other restrictions on use or disclosure. Any unauthorized use, dissemination or copying of this transmission or the information in it is prohibited and may be unlawful. If you have received this transmission in error, please notify the sender immediately by return e-mail, and permanently delete or destroy this e-mail, any attachments, and all copies (digital or paper). Unless expressly stated in this e-mail, nothing in this message should be construed as a digital or electronic signature.

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Chaco plot to PDF

Peter Wang
On Mon, Nov 15, 2010 at 2:47 PM, Jim Radke <[hidden email]> wrote:
> Here are the imports in your noninteractive.py example, so where would I put
> that line ?

The very first line should be OK - above "import os,sys"
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Chaco plot to PDF

Jim Radke
Adding it as the first line generates an error that ETSConfig is not defined which I expected...
   Traceback (most recent call last):
     File "noninteractive.py", line 6, in <module>
       ETSConfig.enable_toolkit='null'
   NameError: name 'ETSConfig' is not defined


If I do this...
   from enthought.etsconfig.api import ETSConfig
   ETSConfig.enable_toolkit='null'

I get this again...
   Unable to access the X Display, is $DISPLAY set properly?





-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Peter Wang
Sent: Monday, November 15, 2010 3:21 PM
To: [hidden email]
Subject: Re: [Enthought-Dev] Chaco plot to PDF

On Mon, Nov 15, 2010 at 2:47 PM, Jim Radke <[hidden email]> wrote:
> Here are the imports in your noninteractive.py example, so where would I put
> that line ?

The very first line should be OK - above "import os,sys"
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev

This e-mail and its attachments are intended only for the individual or entity to whom it is addressed and may contain information that is confidential, privileged, inside information, or subject to other restrictions on use or disclosure. Any unauthorized use, dissemination or copying of this transmission or the information in it is prohibited and may be unlawful. If you have received this transmission in error, please notify the sender immediately by return e-mail, and permanently delete or destroy this e-mail, any attachments, and all copies (digital or paper). Unless expressly stated in this e-mail, nothing in this message should be construed as a digital or electronic signature.
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Chaco plot to PDF

bryce hendrix-2
On Mon, Nov 15, 2010 at 4:43 PM, Jim Radke <[hidden email]> wrote:
Adding it as the first line generates an error that ETSConfig is not defined which I expected...
  Traceback (most recent call last):
    File "noninteractive.py", line 6, in <module>
      ETSConfig.enable_toolkit='null'
  NameError: name 'ETSConfig' is not defined


If I do this...
  from enthought.etsconfig.api import ETSConfig
  ETSConfig.enable_toolkit='null'

I get this again...
  Unable to access the X Display, is $DISPLAY set properly?


The ETSConfig import and setting the enable toolkit should be done prior to any other enthought imports. I suggest making those 2 lines the first lines of your script. If you're still having problems, its possible we've let an unguarded import slip in somewhere...

Bryce

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Chaco plot to PDF

Peter Wang
In reply to this post by Jim Radke
On Mon, Nov 15, 2010 at 3:43 PM, Jim Radke <[hidden email]> wrote:
>
> If I do this...
>   from enthought.etsconfig.api import ETSConfig
>   ETSConfig.enable_toolkit='null'
>
> I get this again...
>   Unable to access the X Display, is $DISPLAY set properly?

This is most confusing; sorry that it has been so hard to figure out.
Can you run this using "python -v noninteractive.py", and maybe
pasting the last few imports before that X server message is
displayed?

Thanks,
Peter
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
12