Re: [Matplotlib-users] Runtime Error on Solaris - Error Closing Dupe File Handle

2015-05-29 Thread Bryan Williams
It seems like it is a conflict of libraries...I've zeroed in to these two
errors:

/usr/include/unistd.h:496:75: error: conflicting declaration of C function
'void swab(const void*, void*, ssize_t)'

and

/usr/include/stdlib.h:144:13: note: previous declaration 'void swab(const
char*, char*, ssize_t)'

I executed a find command and here's what came up:

~>sudo find / -name stdlib.h
*/opt/csw/include/c++/4.9.2/tr1/stdlib.h*
/opt/solarisstudio12.4/lib/compilers/include/CC/gnu/stdlib.h
/opt/solarisstudio12.4/lib/compilers/include/CC/stlport4/stdlib.h
/opt/solarisstudio12.4/lib/compilers/CC-gcc/include/c++/4.8.2/tr1/stdlib.h
*/usr/include/stdlib.h*

>From what it seems, it's calling stdlib.h from the /usr/include folder when
it should be calling it from /opt/csw/include. I'm going to look into
setup.cfg (that or perhaps hack setup.py) and see if it's at all possible
to change it so that it looks in the right one, and then I'll try building
it again.

On Thu, May 28, 2015 at 1:50 PM, Eric Firing  wrote:

> On 2015/05/28 3:13 AM, Bryan Williams wrote:
> > I have gcc on the box. I also installed the C compiler for Solaris (cc),
> > but I couldn't seem to find an option to switch it so that it uses cc
> > rather than gcc.
>
> Maybe you can do this with an environment variable?
>
> export CC=/usr/bin/cc
>
> It does look like there is a problem with scrambled environments.  The
> redefinition warning looks potentially troublesome; and the error looks
> like a conflict between two versions of the standard C library.
>
>  From "man swab" on Solaris:
>
> NAME
>   swab - swap bytes
>
> SYNOPSIS
>   #include 
>
>   void swab(const char *src, char *dest, ssize_t nbytes);
>
>XPG4, SUS, SUSv2, SUSv3
>   #include 
>
>   void swab(const void *restrict  src,  void  *restrict  dest,
>   ssize_t nbytes);
>
> I think you want the second version, consistently, but something is also
> hitting the first version.
>
> Maybe "XPG4" or one of the other 4 options needs to be defined when each
> library is compiled with /usr/bin/cc?  I think the stdlib declaration is
> old; the unistd version is more modern.
>
> That's all very vague, I know.  Obviously, I don't actually know how to
> solve the problem.
>
> Eric
>
>
>
>
> --
> ___
> 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


Re: [Matplotlib-users] Runtime Error on Solaris - Error Closing Dupe File Handle

2015-05-28 Thread Eric Firing
On 2015/05/28 3:13 AM, Bryan Williams wrote:
> I have gcc on the box. I also installed the C compiler for Solaris (cc),
> but I couldn't seem to find an option to switch it so that it uses cc
> rather than gcc.

Maybe you can do this with an environment variable?

export CC=/usr/bin/cc

It does look like there is a problem with scrambled environments.  The 
redefinition warning looks potentially troublesome; and the error looks 
like a conflict between two versions of the standard C library.

 From "man swab" on Solaris:

NAME
  swab - swap bytes

SYNOPSIS
  #include 

  void swab(const char *src, char *dest, ssize_t nbytes);

   XPG4, SUS, SUSv2, SUSv3
  #include 

  void swab(const void *restrict  src,  void  *restrict  dest,
  ssize_t nbytes);

I think you want the second version, consistently, but something is also 
hitting the first version.

Maybe "XPG4" or one of the other 4 options needs to be defined when each 
library is compiled with /usr/bin/cc?  I think the stdlib declaration is 
old; the unistd version is more modern.

That's all very vague, I know.  Obviously, I don't actually know how to 
solve the problem.

Eric



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


Re: [Matplotlib-users] Runtime Error on Solaris - Error Closing Dupe File Handle

2015-05-28 Thread Thomas Caswell
I think there is on open bug about compilation failures on Solaris which we
never sorted out due to not having access to a test machine.

On Thu, May 28, 2015, 09:13 Bryan Williams 
wrote:

> Thanks to the both of you.
>
> First off, apologies for getting back to you several days late. I was out
> of town for the holiday weekend, and I didn't get a chance to work on this
> for the last two days as I had other business to tend to on Tuesday, and
> was out of the office all day Wednesday.
>
> I tried to install from the master build on Github, and it seemed to run
> fine, until I ended up with this error (and verbose details, text wall
> incoming):
>
>
> 
> Edit setup.cfg to change the build options
>
> BUILDING MATPLOTLIB
> matplotlib: yes [1.5.dev1]
> python: yes [3.4.3 (default, May 15 2015, 13:52:23)  [GCC
> 4.9.2]]
>   platform: yes [sunos5]
>
> REQUIRED DEPENDENCIES AND EXTENSIONS
>  numpy: yes [version 1.9.2]
>six: yes [using six version 1.9.0]
>   dateutil: yes [using dateutil version 2.4.2]
>   pytz: yes [using pytz version 2015.4]
>tornado: yes [tornado was not found. It is required for the
> WebAgg backend. pip/easy_install may attempt to
> install it after matplotlib.]
>  pyparsing: yes [using pyparsing version 2.0.3]
> libagg: yes [pkg-config information for 'libagg' could not
> be found. Using local copy.]
>   freetype: yes [version 2.4.8]
>png: yes [version 1.2.35]
>  qhull: yes [pkg-config information for 'qhull' could not
> be
> found. Using local copy.]
>
> OPTIONAL SUBPACKAGES
>sample_data: yes [installing]
>   toolkits: yes [installing]
>  tests: yes [using nose version 1.3.6 / using
> unittest.mock]
> toolkits_tests: yes [using nose version 1.3.6 / using
> unittest.mock]
>
> OPTIONAL BACKEND EXTENSIONS
> macosx: no  [Mac OS-X only]
> qt5agg: no  [PyQt5 not found]
> qt4agg: no  [PySide not found; PyQt4 not found]
>gtk3agg: no  [Requires pygobject to be installed.]
>  gtk3cairo: no  [Requires cairocffi or pycairo to be
> installed.]
> gtkagg: no  [Requires pygtk]
>  tkagg: yes [installing, version not identified]
>  wxagg: no  [requires wxPython]
>gtk: no  [Requires pygtk]
>agg: yes [installing]
>  cairo: no  [cairocffi or pycairo not found]
>  windowing: no  [Microsoft Windows only]
>
> OPTIONAL LATEX DEPENDENCIES
> dvipng: no
>ghostscript: no
>  latex: no
>pdftops: no
>
> running build
> running build_py
> copying lib/matplotlib/mpl-data/matplotlibrc ->
> build/lib.solaris-2.10-sun4v.32bit-3.4/matplotlib/mpl-data
> running build_ext
> building 'matplotlib.ft2font' extension
> gcc -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -fPIC
> -DPY_ARRAY_UNIQUE_SYMBOL=MPL_matplotlib_ft2font_ARRAY_API
> -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION
> -I/usr/local/lib/python3.4/site-packages/numpy/core/include
> -I/usr/local/include -I/usr/local/include/freetype2 -I/usr/local/include
> -I. -I/usr/local/include/python3.4m -c src/ft2font.cpp -o
> build/temp.solaris-2.10-sun4v.32bit-3.4/src/ft2font.o
> In file included from /usr/local/include/python3.4m/Python.h:8:0,
>  from src/mplutils.h:21,
>  from src/ft2font.cpp:8:
> /usr/local/include/python3.4m/pyconfig.h:1387:0: warning:
> "_FILE_OFFSET_BITS" redefined
>  #define _FILE_OFFSET_BITS 64
>  ^
> In file included from
> /opt/csw/lib/gcc/sparc-sun-solaris2.10/4.9.2/include-fixed/wchar.h:20:0,
>  from /opt/csw/include/c++/4.9.2/cwchar:44,
>  from /opt/csw/include/c++/4.9.2/bits/postypes.h:40,
>  from /opt/csw/include/c++/4.9.2/bits/char_traits.h:40,
>  from /opt/csw/include/c++/4.9.2/string:40,
>  from src/ft2font.cpp:5:
> /opt/csw/lib/gcc/sparc-sun-solaris2.10/4.9.2/include-fixed/sys/feature_tests.h:196:0:
> note: this is the location of the previous definition
>  #define _FILE_OFFSET_BITS 32
>  ^
> gcc -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -fPIC
> -DPY_ARRAY_UNIQUE_SYMBOL=MPL_matplotlib_ft2font_ARRAY_API
> -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION
> -I/usr/local/lib/python3.4/site-packages/numpy/core/include
> -I/usr/local/include -I/usr/local/include/freetype2 -I/usr/local/include
> -I. -I/usr/local/include/python3.4m -c src/ft2font_wrapper.cpp -o
> build/temp.solaris-2.10-sun4v.32bit-3.4/src/ft2font_wrapper.o
> In file included from /usr/local/inc

Re: [Matplotlib-users] Runtime Error on Solaris - Error Closing Dupe File Handle

2015-05-28 Thread Bryan Williams
Thanks to the both of you.

First off, apologies for getting back to you several days late. I was out
of town for the holiday weekend, and I didn't get a chance to work on this
for the last two days as I had other business to tend to on Tuesday, and
was out of the office all day Wednesday.

I tried to install from the master build on Github, and it seemed to run
fine, until I ended up with this error (and verbose details, text wall
incoming):


Edit setup.cfg to change the build options

BUILDING MATPLOTLIB
matplotlib: yes [1.5.dev1]
python: yes [3.4.3 (default, May 15 2015, 13:52:23)  [GCC
4.9.2]]
  platform: yes [sunos5]

REQUIRED DEPENDENCIES AND EXTENSIONS
 numpy: yes [version 1.9.2]
   six: yes [using six version 1.9.0]
  dateutil: yes [using dateutil version 2.4.2]
  pytz: yes [using pytz version 2015.4]
   tornado: yes [tornado was not found. It is required for the
WebAgg backend. pip/easy_install may attempt to
install it after matplotlib.]
 pyparsing: yes [using pyparsing version 2.0.3]
libagg: yes [pkg-config information for 'libagg' could not
be found. Using local copy.]
  freetype: yes [version 2.4.8]
   png: yes [version 1.2.35]
 qhull: yes [pkg-config information for 'qhull' could not be
found. Using local copy.]

OPTIONAL SUBPACKAGES
   sample_data: yes [installing]
  toolkits: yes [installing]
 tests: yes [using nose version 1.3.6 / using unittest.mock]
toolkits_tests: yes [using nose version 1.3.6 / using unittest.mock]

OPTIONAL BACKEND EXTENSIONS
macosx: no  [Mac OS-X only]
qt5agg: no  [PyQt5 not found]
qt4agg: no  [PySide not found; PyQt4 not found]
   gtk3agg: no  [Requires pygobject to be installed.]
 gtk3cairo: no  [Requires cairocffi or pycairo to be installed.]
gtkagg: no  [Requires pygtk]
 tkagg: yes [installing, version not identified]
 wxagg: no  [requires wxPython]
   gtk: no  [Requires pygtk]
   agg: yes [installing]
 cairo: no  [cairocffi or pycairo not found]
 windowing: no  [Microsoft Windows only]

OPTIONAL LATEX DEPENDENCIES
dvipng: no
   ghostscript: no
 latex: no
   pdftops: no

running build
running build_py
copying lib/matplotlib/mpl-data/matplotlibrc ->
build/lib.solaris-2.10-sun4v.32bit-3.4/matplotlib/mpl-data
running build_ext
building 'matplotlib.ft2font' extension
gcc -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -fPIC
-DPY_ARRAY_UNIQUE_SYMBOL=MPL_matplotlib_ft2font_ARRAY_API
-DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION
-I/usr/local/lib/python3.4/site-packages/numpy/core/include
-I/usr/local/include -I/usr/local/include/freetype2 -I/usr/local/include
-I. -I/usr/local/include/python3.4m -c src/ft2font.cpp -o
build/temp.solaris-2.10-sun4v.32bit-3.4/src/ft2font.o
In file included from /usr/local/include/python3.4m/Python.h:8:0,
 from src/mplutils.h:21,
 from src/ft2font.cpp:8:
/usr/local/include/python3.4m/pyconfig.h:1387:0: warning:
"_FILE_OFFSET_BITS" redefined
 #define _FILE_OFFSET_BITS 64
 ^
In file included from
/opt/csw/lib/gcc/sparc-sun-solaris2.10/4.9.2/include-fixed/wchar.h:20:0,
 from /opt/csw/include/c++/4.9.2/cwchar:44,
 from /opt/csw/include/c++/4.9.2/bits/postypes.h:40,
 from /opt/csw/include/c++/4.9.2/bits/char_traits.h:40,
 from /opt/csw/include/c++/4.9.2/string:40,
 from src/ft2font.cpp:5:
/opt/csw/lib/gcc/sparc-sun-solaris2.10/4.9.2/include-fixed/sys/feature_tests.h:196:0:
note: this is the location of the previous definition
 #define _FILE_OFFSET_BITS 32
 ^
gcc -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -fPIC
-DPY_ARRAY_UNIQUE_SYMBOL=MPL_matplotlib_ft2font_ARRAY_API
-DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION
-I/usr/local/lib/python3.4/site-packages/numpy/core/include
-I/usr/local/include -I/usr/local/include/freetype2 -I/usr/local/include
-I. -I/usr/local/include/python3.4m -c src/ft2font_wrapper.cpp -o
build/temp.solaris-2.10-sun4v.32bit-3.4/src/ft2font_wrapper.o
In file included from /usr/local/include/python3.4m/Python.h:8:0,
 from src/mplutils.h:21,
 from src/ft2font_wrapper.cpp:1:
/usr/local/include/python3.4m/pyconfig.h:1387:0: warning:
"_FILE_OFFSET_BITS" redefined
 #define _FILE_OFFSET_BITS 64
 ^
In file included from /usr/include/sys/int_types.h:34:0,
 from /usr/include/sys/stdint.h:17,
 from /usr/include/stdint.h

Re: [Matplotlib-users] Runtime Error on Solaris - Error Closing Dupe File Handle

2015-05-24 Thread Thomas Caswell
Bryan,

If you subscribe to the list you will be able to post with out moderation.

Does this happen with any of the other sample data?

I don't think that `get_sample_data` is doing you any good here as you are
passing it an absolute path (from `os.getcwd()`) which is passed into
`os.path.join` which when it encounters and absolute path discards
everything to the left so that line is just returning back your input.

Does it work to open any other png or does _only_ this png have issues?

You are reaching into the nominally private parts of the mpl api here, I
would suggest using `mpl.image.imread` instead.

It might be worth using something like PIL/pillow, imread (
https://pypi.python.org/pypi/imread), imageio (https://imageio.github.io/)
or scikit-image for alternate implementations of png readers.

None of the core developers have access to a Solaris machine so it is very
difficult for us to provide much better help on this.

Tom

On Sun, May 24, 2015 at 1:38 PM Bryan Williams 
wrote:

> Good afternoon,
>
>
>
> My name is Bryan Williams. I work for the Florida Forest Service in their
> Forest Logistics and Support Bureau.
>
>
>
> I’m working on a program that takes weather data and visualizes it using
> matplotlib and Basemap. I’m currently having an issue with matplotlib 1.4.3
> for Python 3.4.3 running under Solaris 5.10. I am getting a Runtime Error
> whenever I try calling the read_png file from matplotlib._png. (I’m using
> this to add a small .png file of the Forest Service’s sheld to the
> picture). The error is the following:
>
>
>
> Traceback (most recent call last):
>
>   File "drawmaps.py", line 845, in 
>
> arr_lena = read_png(fn)
>
> RuntimeError: Error closing dupe file handle
>
>
>
> I don’t quite understand the error I’m getting, and as you can see, the
> traceback gives very little information. I also tried Google for help, but
> to no avail; entering the error message as is into Google doesn’t return
> anything relating to the problem, and putting quotes around “Error closing
> dupe file handle” yields about 10 results, with one of them being an
> unanswered question from 2014 regarding the same issue.
>
>
>
> As per your request on the website, here’s what I get from uname –a:
>
>
>
> SunOS [server name withheld] 5.10 Generic_141444-09 sun4v sparc
> SUNW,SPARC-Enterprise-T5220
>
>
>
> I built Python 3.4.3 from source and installed matplotlib through pip, and
> didn’t make any changes to the matplotlibrc file.
>
>
>
> I was able to reproduce the problem again running these commands in the
> Python interactive prompt, which emulates the snippet of script that causes
> the error:
>
>
>
> Python 3.4.3 (default, May 15 2015, 13:52:23)
>
> [GCC 4.9.2] on sunos5
>
> Type "help", "copyright", "credits" or "license" for more information.
>
> >>> from matplotlib._png import read_png
>
> >>> from matplotlib.cbook import get_sample_data
>
> >>> import os; path=os.getcwd()
>
> >>> fn = get_sample_data(path + '/resources/shield.png', asfileobj=False)
>
> >>> arr_lena = read_png(fn)
>
> Traceback (most recent call last):
>
>   File "", line 1, in 
>
> RuntimeError: Error closing dupe file handle
>
>
>
>
>
> If you’d like a copy of the problem script, please let me know. Any and
> all help is greatly appreciated.
>
>
>
> Thank you in advance!
>
>
>
> -- BMW
>
> --
> One dashboard for servers and applications across Physical-Virtual-Cloud
> Widest out-of-the-box monitoring support with 50+ applications
> Performance metrics, stats and reports that give you Actionable Insights
> Deep dive visibility with transaction tracing using APM Insight.
> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
--
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Runtime Error on Solaris - Error Closing Dupe File Handle

2015-05-24 Thread Benjamin Root
Bryan,

First off, avoid importing things from modules that start with an
underscore. Because Python doesn't have semantics for public/private APIs
like C++ and Java does, the underscore is treated as an indicator to
developers that it is to be treated as private. The implication is that we
are free to change the API of "private" modules and functions between
releases, without warning or recourse, which would lead to breakage of your
scripts if you use them. So, use it at your peril.

I would recommend using plt.imread() instead, or use the Pillow package to
read your data as a numpy array that you can then plot.

Now, onto your issue. I suspect it might be related to changes we made in
1.4 to have a cross-platform file-handle. However, the solaris platform is
not regularly tested by anybody, so it is quite likely we broke something
there. Now, in the master branch on github, we completely rewrote nearly
all of the C++ code, so I while it may still be broken there, perhaps we
might get a more useful error message or something different entirely? Can
you try building from the master branch and letting us know?

Cheers!
Ben Root

P.S. - The script in question wasn't perhaps written originally by a former
Meteorologist colleague from the University of Oklahoma? ;-) If it was, he
was my officemate!


On Thu, May 21, 2015 at 4:08 PM, Bryan Williams <
bryan.williams7...@gmail.com> wrote:

> Good afternoon,
>
>
>
> My name is Bryan Williams. I work for the Florida Forest Service in their
> Forest Logistics and Support Bureau.
>
>
>
> I’m working on a program that takes weather data and visualizes it using
> matplotlib and Basemap. I’m currently having an issue with matplotlib 1.4.3
> for Python 3.4.3 running under Solaris 5.10. I am getting a Runtime Error
> whenever I try calling the read_png file from matplotlib._png. (I’m using
> this to add a small .png file of the Forest Service’s sheld to the
> picture). The error is the following:
>
>
>
> Traceback (most recent call last):
>
>   File "drawmaps.py", line 845, in 
>
> arr_lena = read_png(fn)
>
> RuntimeError: Error closing dupe file handle
>
>
>
> I don’t quite understand the error I’m getting, and as you can see, the
> traceback gives very little information. I also tried Google for help, but
> to no avail; entering the error message as is into Google doesn’t return
> anything relating to the problem, and putting quotes around “Error closing
> dupe file handle” yields about 10 results, with one of them being an
> unanswered question from 2014 regarding the same issue.
>
>
>
> As per your request on the website, here’s what I get from uname –a:
>
>
>
> SunOS [server name withheld] 5.10 Generic_141444-09 sun4v sparc
> SUNW,SPARC-Enterprise-T5220
>
>
>
> I built Python 3.4.3 from source and installed matplotlib through pip, and
> didn’t make any changes to the matplotlibrc file.
>
>
>
> I was able to reproduce the problem again running these commands in the
> Python interactive prompt, which emulates the snippet of script that causes
> the error:
>
>
>
> Python 3.4.3 (default, May 15 2015, 13:52:23)
>
> [GCC 4.9.2] on sunos5
>
> Type "help", "copyright", "credits" or "license" for more information.
>
> >>> from matplotlib._png import read_png
>
> >>> from matplotlib.cbook import get_sample_data
>
> >>> import os; path=os.getcwd()
>
> >>> fn = get_sample_data(path + '/resources/shield.png', asfileobj=False)
>
> >>> arr_lena = read_png(fn)
>
> Traceback (most recent call last):
>
>   File "", line 1, in 
>
> RuntimeError: Error closing dupe file handle
>
>
>
>
>
> If you’d like a copy of the problem script, please let me know. Any and
> all help is greatly appreciated.
>
>
>
> Thank you in advance!
>
>
>
> -- BMW
>
>
> --
> One dashboard for servers and applications across Physical-Virtual-Cloud
> Widest out-of-the-box monitoring support with 50+ applications
> Performance metrics, stats and reports that give you Actionable Insights
> Deep dive visibility with transaction tracing using APM Insight.
> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
--
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Runtime Error on Solaris - Error Closing Dupe File Handle

2015-05-24 Thread Bryan Williams
Good afternoon,



My name is Bryan Williams. I work for the Florida Forest Service in their
Forest Logistics and Support Bureau.



I’m working on a program that takes weather data and visualizes it using
matplotlib and Basemap. I’m currently having an issue with matplotlib 1.4.3
for Python 3.4.3 running under Solaris 5.10. I am getting a Runtime Error
whenever I try calling the read_png file from matplotlib._png. (I’m using
this to add a small .png file of the Forest Service’s sheld to the
picture). The error is the following:



Traceback (most recent call last):

  File "drawmaps.py", line 845, in 

arr_lena = read_png(fn)

RuntimeError: Error closing dupe file handle



I don’t quite understand the error I’m getting, and as you can see, the
traceback gives very little information. I also tried Google for help, but
to no avail; entering the error message as is into Google doesn’t return
anything relating to the problem, and putting quotes around “Error closing
dupe file handle” yields about 10 results, with one of them being an
unanswered question from 2014 regarding the same issue.



As per your request on the website, here’s what I get from uname –a:



SunOS [server name withheld] 5.10 Generic_141444-09 sun4v sparc
SUNW,SPARC-Enterprise-T5220



I built Python 3.4.3 from source and installed matplotlib through pip, and
didn’t make any changes to the matplotlibrc file.



I was able to reproduce the problem again running these commands in the
Python interactive prompt, which emulates the snippet of script that causes
the error:



Python 3.4.3 (default, May 15 2015, 13:52:23)

[GCC 4.9.2] on sunos5

Type "help", "copyright", "credits" or "license" for more information.

>>> from matplotlib._png import read_png

>>> from matplotlib.cbook import get_sample_data

>>> import os; path=os.getcwd()

>>> fn = get_sample_data(path + '/resources/shield.png', asfileobj=False)

>>> arr_lena = read_png(fn)

Traceback (most recent call last):

  File "", line 1, in 

RuntimeError: Error closing dupe file handle





If you’d like a copy of the problem script, please let me know. Any and all
help is greatly appreciated.



Thank you in advance!



-- BMW
--
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Runtime error

2014-01-27 Thread Phil Elson
Hi Kai,

I'm afraid I've never heard of this one. Do you have a full error log?

Thanks,


On 26 January 2014 02:40,  wrote:

>
>
> Hi,
>
> I'm trying to use matplotlib to generate pictures for my website view. The
> framwork I use is pyramid. But I got an error when I try to refresh my page
> two or more times. The message is as follow:
> "This application has requested the Runtime to terminate it in an unusual
> way. Please contact the application's support team for more information."
>
> Is it a win32 error? I use python27 win32 and matplotlib 1.2.
>
> Thx
>
>
> Kai Wang
>
>
>
>
>
>
> --
> CenturyLink Cloud: The Leader in Enterprise Cloud Services.
> Learn Why More Businesses Are Choosing CenturyLink Cloud For
> Critical Workloads, Development Environments & Everything In Between.
> Get a Quote or Start a Free Trial Today.
>
> http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Runtime error

2014-01-25 Thread kaiwang


Hi,


I'm trying to use matplotlib to generate pictures for my website view. The 
framwork I use is pyramid. But I got an error when I try to refresh my page two 
or more times. The message is as follow:
"This application has requested the Runtime to terminate it in an unusual way. 
Please contact the application's support team for more information."


Is it a win32 error? I use python27 win32 and matplotlib 1.2.


Thx




Kai Wang




--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Runtime error with matplotlib in IDLE

2012-03-12 Thread Catherine Thwaites
On Sun, Mar 11, 2012 at 11:27 PM, gsal  wrote:

>
> Don't have a solution; I was just wondering if you have tried something
> else,
> like using ipython instead of IDLE.  ipython may be better suited for
> threading and working with pylab, etc.
>
>
Thanks for the reply. I do like ipython might try the gui version.
--
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Runtime error with matplotlib in IDLE

2012-03-11 Thread gsal

Don't have a solution; I was just wondering if you have tried something else,
like using ipython instead of IDLE.  ipython may be better suited for
threading and working with pylab, etc. 
-- 
View this message in context: 
http://old.nabble.com/Runtime-error-with-matplotlib-in-IDLE-tp33478456p33480306.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


--
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Runtime error with matplotlib in IDLE

2012-03-10 Thread Catherine Thwaites
I have an error when running my script using matplotlib using IDLE. I
suspect it is something to do with either numpy or matplotlib and I was
wondering if any other users have had a similar problem. I have recently
installed Python, matplotlib and numpy, I have not had it working correctly
using IDLE on this machine. The error message is:

Runtime Error!

Program: C:\Python27\pythonw.exe

This application has requested the Runtime to terminate it in an unusual
way.
Please contact the application's supporter team for more information.

The window header says Microsoft Visual C++ Runtime Library (which seems to
be about debugging). The error occurs about 50% of the time. When I run my
script in the command line it runs fine everytime. I am using matplotlib
and generating a pdf. If I remove the pdf generation step I still get the
error. But running another script (on the csv module) don't seem to
generate the error. I have searched on the internet without luck
(suggestion of installing visual studio which I have got) or posting to the
scipy list (well Im not using scipy).

I am using Win7 32 bit and matplotlib 1.1 and numpy 1.6.1 and python 2.7.
Has anyone else had similar message?

Catherine
--
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Runtime Error - Need Advice

2010-02-10 Thread Lee Boger
Thanks for all your suggestions Christoph. Launching the Tk Python Shell 
instead of PythonWin seems to work consistently - I get the correct plot 
figure and the correct log_plot.png file created everytime I run the 
script. I never did install Ipython, but I'll consider that for a future 
upgrade.

Lee




Christoph Gohlke  
02/09/2010 04:35 PM

To
matplotlib-users 
cc

Subject
Re: [Matplotlib-users] Runtime Error - Need Advice




Caterpillar: Confidential Green Retain Until: 03/11/2010 



I can now reproduce this. It seems the same old problem that PythonWin
can not reliably run matplotlib because successive runs of the script
use the same interpreter. Ipython should work. Append pylab.close() to
your script; at least it will not crash on the second run.

-- Christoph

On 2/9/2010 10:44 AM, Lee Boger wrote:
> 
> Although, if I close the figure then re-run the script, a new figure
> pops up but it doesn't have any data plotted. Interpreter is now locked
> up. I'm still not fixing it completely. There is also no figure stored
> as a file log_plot.
> 
> Lee
> 
> 
> *Christoph Gohlke *
> 
> 02/09/2010 01:23 PM
> 
> 
> To
>    Lee Boger 
> cc
> 
> Subject
>Re: [Matplotlib-users] Runtime Error - Need Advice
> 
> 
> 
> 
> 
> Caterpillar: Confidential GreenRetain Until: 03/11/2010 
> 
> 
> 
> 
> Change the last line to pylab.show() and it should work.
> 
> Anyway, this example should not crash the interpreter. I can reproduce
> the crash on Python 2.4, 2.5, and 2.6 (32 and 64 bit) on Windows with
> mpl 0.99.1 but not on Ubuntu 9.1 with mpl 0.99.0.
> 
> The shortest example that crashes is:
> 
> python -c "import pylab;pylab.subplot(111).figure.show()"
> 
> or on the interactive prompt:
> 
>>>> import pylab
>>>> pylab.subplot(111).figure.show()
>>>> exit()
> Fatal Python error: PyEval_RestoreThread: NULL tstate
> 
> This application has requested the Runtime to terminate it in an unusual
> way.
> Please contact the application's support team for more information.
> 
> 
> -- Christoph
> 
> On 2/9/2010 7:57 AM, Lee Boger wrote:
>>
>> Windows XP Professional with Python 2.5 installed (pywin32 build 210) -
>> came with dSPACE software package
>>
>> Downloaded and installed matplotlib-0.99.1.win32-py2.5.exe from
>> sourceforge.net
>>
>> Downloaded and installed numpy-1.4.0-win32-superpack-python2.5.exe from
>> sourceforge.net
>>
>> Executing the following simple "log plot" script within PythonWin:
>>
>> *from* matplotlib *import* pylab
>>
>> # Create some artificial data.
>> test_frequency = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 
16,
>> 17, 18, 19, 20]
>> test_results = [-0.2, -0.7, -1.0, -1.5, -2.0, -2.5, -3.0, -3.5, -4, -5,
>> -6, -7.1, -8, -9, -10, -11, -12, -15, -20, -25]
>> spec_frequency = [6, 8]
>> spec_results = [-3.0, -3.0]
>>
>> # Plot
>> figure = pylab.subplot(111)
>> figure.semilogx()
>> figure.scatter(test_frequency, test_results, s=20, c='b', marker='s',
>> edgecolors='none')
>> figure.scatter(spec_frequency, spec_results, s=40, c='g', marker='s',
>> edgecolors='none')
>> figure.grid(True)
>> figure.set_xlabel(r"Frequency (Hz)", fontsize = 12)
>> figure.set_ylabel(r"Actuator Response (db)", fontsize = 12)
>>
>> figure.figure.savefig('log_plot')
>> figure.figure.show()
>>
>>
>> Plots a figure on the screen that looks correct, then the following
>> error (when I click OK, PythonWin closes)
>>
>>
>>
>> Any advice would be appreciated. Maybe it's an installation or setup
>> issue, but I'm pretty knew to Python programming and don't know how to
>> debug this.
>>
>> Lee Boger
>>
>>
>>
>> 
--
>> The Planet: dedicated and managed hosting, cloud storage, colocation
>> Stay online with enterprise data centers and the best network in the
> business
>> Choose flexible plans and management services without long-term 
contracts
>> Personal 24x7 support from experience hosting pros just a phone call 
away.
>> http://p.sf.net/sfu/theplanet-com
>>
>>
>>
>> ___
>> Matplotlib-users mailing list
>> Matplotlib-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 


Re: [Matplotlib-users] Runtime Error - Need Advice

2010-02-09 Thread Christoph Gohlke
To close this thread: the PyEval_RestoreThread crash is a known bug in
the tkagg backend on Windows. See line 375 of backend_tkagg.py:

def show(self):
"""
this function doesn't segfault but causes the
PyEval_RestoreThread: NULL state bug on win32
"""

-- Christoph

On 2/9/2010 10:26 AM, Christoph Gohlke wrote:
> Change the last line to pylab.show() and it should work.
> 
> Anyway, this example should not crash the interpreter. I can reproduce
> the crash on Python 2.4, 2.5, and 2.6 (32 and 64 bit) on Windows with
> mpl 0.99.1 but not on Ubuntu 9.1 with mpl 0.99.0.
> 
> The shortest example that crashes is:
> 
> python -c "import pylab;pylab.subplot(111).figure.show()"
> 
> or on the interactive prompt:
> 
 import pylab
 pylab.subplot(111).figure.show()
 exit()
> Fatal Python error: PyEval_RestoreThread: NULL tstate
> 
> This application has requested the Runtime to terminate it in an unusual
> way.
> Please contact the application's support team for more information.
> 
> 
> -- Christoph
> 
> On 2/9/2010 7:57 AM, Lee Boger wrote:
>> > 
>> > Windows XP Professional with Python 2.5 installed (pywin32 build 210) -
>> > came with dSPACE software package
>> > 
>> > Downloaded and installed matplotlib-0.99.1.win32-py2.5.exe from
>> > sourceforge.net
>> > 
>> > Downloaded and installed numpy-1.4.0-win32-superpack-python2.5.exe from
>> > sourceforge.net
>> > 
>> > Executing the following simple "log plot" script within PythonWin:
>> > 
>> > *from* matplotlib *import* pylab
>> > 
>> > # Create some artificial data.
>> > test_frequency = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
>> > 17, 18, 19, 20]
>> > test_results = [-0.2, -0.7, -1.0, -1.5, -2.0, -2.5, -3.0, -3.5, -4, -5,
>> > -6, -7.1, -8, -9, -10, -11, -12, -15, -20, -25]
>> > spec_frequency = [6, 8]
>> > spec_results = [-3.0, -3.0]
>> > 
>> > # Plot
>> > figure = pylab.subplot(111)
>> > figure.semilogx()
>> > figure.scatter(test_frequency, test_results, s=20, c='b', marker='s',
>> > edgecolors='none')
>> > figure.scatter(spec_frequency, spec_results, s=40, c='g', marker='s',
>> > edgecolors='none')
>> > figure.grid(True)
>> > figure.set_xlabel(r"Frequency (Hz)", fontsize = 12)
>> > figure.set_ylabel(r"Actuator Response (db)", fontsize = 12)
>> > 
>> > figure.figure.savefig('log_plot')
>> > figure.figure.show()
>> > 
>> > 
>> > Plots a figure on the screen that looks correct, then the following
>> > error (when I click OK, PythonWin closes)
>> > 
>> > 
>> > 
>> > Any advice would be appreciated. Maybe it's an installation or setup
>> > issue, but I'm pretty knew to Python programming and don't know how to
>> > debug this.
>> > 
>> > Lee Boger

--
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Runtime Error - Need Advice

2010-02-09 Thread Christoph Gohlke
I can now reproduce this. It seems the same old problem that PythonWin
can not reliably run matplotlib because successive runs of the script
use the same interpreter. Ipython should work. Append pylab.close() to
your script; at least it will not crash on the second run.

-- Christoph

On 2/9/2010 10:44 AM, Lee Boger wrote:
> 
> Although, if I close the figure then re-run the script, a new figure
> pops up but it doesn't have any data plotted. Interpreter is now locked
> up. I'm still not fixing it completely. There is also no figure stored
> as a file log_plot.
> 
> Lee
> 
> 
> *Christoph Gohlke *
> 
> 02/09/2010 01:23 PM
> 
>   
> To
>   Lee Boger 
> cc
>   
> Subject
>   Re: [Matplotlib-users] Runtime Error - Need Advice
> 
> 
>   
> 
> 
> Caterpillar: Confidential GreenRetain Until: 03/11/2010
> 
> 
> 
> 
> Change the last line to pylab.show() and it should work.
> 
> Anyway, this example should not crash the interpreter. I can reproduce
> the crash on Python 2.4, 2.5, and 2.6 (32 and 64 bit) on Windows with
> mpl 0.99.1 but not on Ubuntu 9.1 with mpl 0.99.0.
> 
> The shortest example that crashes is:
> 
> python -c "import pylab;pylab.subplot(111).figure.show()"
> 
> or on the interactive prompt:
> 
>>>> import pylab
>>>> pylab.subplot(111).figure.show()
>>>> exit()
> Fatal Python error: PyEval_RestoreThread: NULL tstate
> 
> This application has requested the Runtime to terminate it in an unusual
> way.
> Please contact the application's support team for more information.
> 
> 
> -- Christoph
> 
> On 2/9/2010 7:57 AM, Lee Boger wrote:
>>
>> Windows XP Professional with Python 2.5 installed (pywin32 build 210) -
>> came with dSPACE software package
>>
>> Downloaded and installed matplotlib-0.99.1.win32-py2.5.exe from
>> sourceforge.net
>>
>> Downloaded and installed numpy-1.4.0-win32-superpack-python2.5.exe from
>> sourceforge.net
>>
>> Executing the following simple "log plot" script within PythonWin:
>>
>> *from* matplotlib *import* pylab
>>
>> # Create some artificial data.
>> test_frequency = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
>> 17, 18, 19, 20]
>> test_results = [-0.2, -0.7, -1.0, -1.5, -2.0, -2.5, -3.0, -3.5, -4, -5,
>> -6, -7.1, -8, -9, -10, -11, -12, -15, -20, -25]
>> spec_frequency = [6, 8]
>> spec_results = [-3.0, -3.0]
>>
>> # Plot
>> figure = pylab.subplot(111)
>> figure.semilogx()
>> figure.scatter(test_frequency, test_results, s=20, c='b', marker='s',
>> edgecolors='none')
>> figure.scatter(spec_frequency, spec_results, s=40, c='g', marker='s',
>> edgecolors='none')
>> figure.grid(True)
>> figure.set_xlabel(r"Frequency (Hz)", fontsize = 12)
>> figure.set_ylabel(r"Actuator Response (db)", fontsize = 12)
>>
>> figure.figure.savefig('log_plot')
>> figure.figure.show()
>>
>>
>> Plots a figure on the screen that looks correct, then the following
>> error (when I click OK, PythonWin closes)
>>
>>
>>
>> Any advice would be appreciated. Maybe it's an installation or setup
>> issue, but I'm pretty knew to Python programming and don't know how to
>> debug this.
>>
>> Lee Boger
>>
>>
>>
>> --
>> The Planet: dedicated and managed hosting, cloud storage, colocation
>> Stay online with enterprise data centers and the best network in the
> business
>> Choose flexible plans and management services without long-term contracts
>> Personal 24x7 support from experience hosting pros just a phone call away.
>> http://p.sf.net/sfu/theplanet-com
>>
>>
>>
>> ___
>> Matplotlib-users mailing list
>> Matplotlib-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 

--
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Runtime Error - Need Advice

2010-02-09 Thread Lee Boger
Python version 2.5.1, Tk version 8.4, IDLE version 1.2.1

Lee



Christoph Gohlke  
02/09/2010 03:08 PM

To
matplotlib-users 
cc

Subject
Re: [Matplotlib-users] Runtime Error - Need Advice




Caterpillar: Confidential Green Retain Until: 03/11/2010 



I am not sure what's going on. The script you posted imports pylab in
the first line. It should be defined. The scrit works just fine after
the proposed changes, even from Pythonwin. Did you completely quit
Pythonwin after the crashes and made sure no corrupted python instance
was left running? Please send the version string of your python
installation.

Christoph

On 2/9/2010 11:10 AM, Lee Boger wrote:
> 
> Per another suggestion, I did uninstall numpy 1.4 and installed numpy
> 1.3, but got the same results. Using pylab.savefig('log_plot) resulted
> in the following error:
> 
> Traceback (most recent call last):
>   File "C:\Program Files\Common
> 
Files\dSPACE\Python25\lib\site-packages\Pythonwin\pywin\framework\scriptutils.py",
> line 310, in RunScript
> exec codeObject in __main__.__dict__
>   File "C:\Documents and Settings\BogerLC\My Documents\Script2.py", line
> 20, in 
> pylab.savefig('log_plot')
> NameError: name 'pylab' is not defined
> 
> Using pyplot.savefig('log_plot') does not have an error, but I still get
> no file saved. Maybe it is a "backend" thing, which I know nothing
> about. I'll look into it. Thanks.
> 
> Lee
> 
> 
> *Christoph Gohlke *
> 
> 02/09/2010 02:03 PM
> 
> 
> To
>matplotlib-users 
> cc
> 
> Subject
>Re: [Matplotlib-users] Runtime Error - Need Advice
> 
> 
> 
> 
> 
> Caterpillar: Confidential GreenRetain Until: 03/11/2010 
> 
> 
> 
> 
> Use pylab.savefig('log_plot'). Also saving the figure to file and
> showing it interactively in the same script might involve switching
> backends, which might not work as expected.
> 
> It is advisable to downgrade to numpy 1.3.
> 
> -- Christoph
> 
> On 2/9/2010 10:44 AM, Lee Boger wrote:
>>
>> Although, if I close the figure then re-run the script, a new figure
>> pops up but it doesn't have any data plotted. Interpreter is now locked
>> up. I'm still not fixing it completely. There is also no figure stored
>> as a file log_plot.
>>
>> Lee
>>
>>
>> *Christoph Gohlke *
>>
>> 02/09/2010 01:23 PM
>>
>> 
>> To
>>  Lee Boger 
>> cc
>> 
>> Subject
>>  Re: [Matplotlib-users] Runtime Error - Need Advice
>>
>>
>> 
>>
>>
>> Caterpillar: Confidential GreenRetain Until: 03/11/2010 
>>
>>
>>
>>
>> Change the last line to pylab.show() and it should work.
>>
>> Anyway, this example should not crash the interpreter. I can reproduce
>> the crash on Python 2.4, 2.5, and 2.6 (32 and 64 bit) on Windows with
>> mpl 0.99.1 but not on Ubuntu 9.1 with mpl 0.99.0.
>>
>> The shortest example that crashes is:
>>
>> python -c "import pylab;pylab.subplot(111).figure.show()"
>>
>> or on the interactive prompt:
>>
>>>>> import pylab
>>>>> pylab.subplot(111).figure.show()
>>>>> exit()
>> Fatal Python error: PyEval_RestoreThread: NULL tstate
>>
>> This application has requested the Runtime to terminate it in an 
unusual
>> way.
>> Please contact the application's support team for more information.
>>
>>
>> -- Christoph
>>
>> On 2/9/2010 7:57 AM, Lee Boger wrote:
>>>
>>> Windows XP Professional with Python 2.5 installed (pywin32 build 210) 
-
>>> came with dSPACE software package
>>>
>>> Downloaded and installed matplotlib-0.99.1.win32-py2.5.exe from
>>> sourceforge.net
>>>
>>> Downloaded and installed numpy-1.4.0-win32-superpack-python2.5.exe 
from
>>> sourceforge.net
>>>
>>> Executing the following simple "log plot" script within PythonWin:
>>>
>>> *from* matplotlib *import* pylab
>>>
>>> # Create some artificial data.
>>> test_frequency = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 
16,
>>> 17, 18, 19, 20]
>>> test_results = [-0.2, -0.7, -1.0, -1.5, -2.0, -2.5, -3.0, -3.5, -4, 
-5,
>>> -6, -7.1, -8, -9, -10, -11, -12, -15, -20, -25]
>>> spec_frequency = [6, 8]
>>> spec_results = [-3.0, -3.0]
>>>
>>> # Plot
>>> figure = pylab.subplot(111)
>>> figure.semilogx()
>>> figure.sca

Re: [Matplotlib-users] Runtime Error - Need Advice

2010-02-09 Thread Lee Boger
I tried something that seems to work consistently - I get the correct plot 
figure and the correct log_plot.png file created everytime I run the 
script.

>From the Start menu, I chose All Programs-Python2.5-IDLE (Python GUI) 
instead of All Programs-Python2.5-PythonWin, which creates the Tk Python 
Shell. I then open the script file and run it. I think you were right. 
Does this make sense?

Lee

__

Thanks for your help. I'll look into ipython.

Lee



Eric Firing  
02/09/2010 02:31 PM

To
Lee Boger , matplotlib-users 

cc

Subject
Re: [Matplotlib-users] Runtime Error - Need Advice




Caterpillar: Confidential Green Retain Until: 03/11/2010 



Lee Boger wrote:
> 
> Thanks for the quick feedback. I changed the last line from 
> figure.figure.show() to pyplot.show() and it worked without crashing the 

> interpreter. However, if I close the figure then re-run the script, a 
> new figure pops up but it doesn't have any data plotted. Interpreter is 
> now locked up, the run-time error occurred and no figure stored as a 
> file log_plot. I un-installed numpy-1.4.0 and installed numpy-1.3.0, but 

> the results were as I just described.
> 
> Lee
> 


At this point a Windows user may need to step in.  I know nothing about 
PythonWin.  My suspicion is that this is a problem of dueling event 
loops, and one solution would be to use ipython instead of pythonwin.

(Note that you typically need to use "reply to all" on this list, 
otherwise the reply does not get copied to the list.)

Eric

> 
> 
> *Eric Firing *
> 
> 02/09/2010 01:35 PM
> 
> 
> To
>Lee Boger 
> cc
>    matplotlib-users@lists.sourceforge.net
> Subject
>Re: [Matplotlib-users] Runtime Error - Need Advice
> 
> 
> 
> 
> 
> Caterpillar: Confidential GreenRetain Until: 03/11/2010 
> 
> 
> 
> 
> Lee Boger wrote:
>  >
>  > Windows XP Professional with Python 2.5 installed (pywin32 build 210) 
-
>  > came with dSPACE software package
>  >
>  > Downloaded and installed matplotlib-0.99.1.win32-py2.5.exe from
>  > sourceforge.net
>  >
>  > Downloaded and installed numpy-1.4.0-win32-superpack-python2.5.exe 
from
>  > sourceforge.net
> 
> I suspect this is the problem: numpy-1.4.0 is considered broken and has
> been withdrawn.  Specifically, it introduces binary incompatibility with
> programs compiled against prior versions of numpy, including matplotlib.
> If you go back to the numpy sourceforge site now, I think you will see
> an earlier version that you can install in place of 1.4.0 (after
> removing the latter).
> 
> Eric
> 
>  >
>  > Executing the following simple "log plot" script within PythonWin:
>  >
>  > *from* matplotlib *import* pylab
>  >
>  > # Create some artificial data.
>  > test_frequency = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 
16,
>  > 17, 18, 19, 20]
>  > test_results = [-0.2, -0.7, -1.0, -1.5, -2.0, -2.5, -3.0, -3.5, -4, 
-5,
>  > -6, -7.1, -8, -9, -10, -11, -12, -15, -20, -25]
>  > spec_frequency = [6, 8]
>  > spec_results = [-3.0, -3.0]
>  >
>  > # Plot
>  > figure = pylab.subplot(111)
>  > figure.semilogx()
>  > figure.scatter(test_frequency, test_results, s=20, c='b', marker='s',
>  > edgecolors='none')
>  > figure.scatter(spec_frequency, spec_results, s=40, c='g', marker='s',
>  > edgecolors='none')
>  > figure.grid(True)
>  > figure.set_xlabel(r"Frequency (Hz)", fontsize = 12)
>  > figure.set_ylabel(r"Actuator Response (db)", fontsize = 12)
>  >
>  > figure.figure.savefig('log_plot')
>  > figure.figure.show()
>  >
>  >
>  > Plots a figure on the screen that looks correct, then the following
>  > error (when I click OK, PythonWin closes)
>  >
>  >
>  >
>  > Any advice would be appreciated. Maybe it's an installation or setup
>  > issue, but I'm pretty knew to Python programming and don't know how 
to
>  > debug this.
>  >
>  > Lee Boger
> 


--
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Runtime Error - Need Advice

2010-02-09 Thread Christoph Gohlke
I am not sure what's going on. The script you posted imports pylab in
the first line. It should be defined. The scrit works just fine after
the proposed changes, even from Pythonwin. Did you completely quit
Pythonwin after the crashes and made sure no corrupted python instance
was left running? Please send the version string of your python
installation.

Christoph

On 2/9/2010 11:10 AM, Lee Boger wrote:
> 
> Per another suggestion, I did uninstall numpy 1.4 and installed numpy
> 1.3, but got the same results. Using pylab.savefig('log_plot) resulted
> in the following error:
> 
> Traceback (most recent call last):
>   File "C:\Program Files\Common
> Files\dSPACE\Python25\lib\site-packages\Pythonwin\pywin\framework\scriptutils.py",
> line 310, in RunScript
> exec codeObject in __main__.__dict__
>   File "C:\Documents and Settings\BogerLC\My Documents\Script2.py", line
> 20, in 
> pylab.savefig('log_plot')
> NameError: name 'pylab' is not defined
> 
> Using pyplot.savefig('log_plot') does not have an error, but I still get
> no file saved. Maybe it is a "backend" thing, which I know nothing
> about. I'll look into it. Thanks.
> 
> Lee
> 
> 
> *Christoph Gohlke *
> 
> 02/09/2010 02:03 PM
> 
>   
> To
>   matplotlib-users 
> cc
>   
> Subject
>   Re: [Matplotlib-users] Runtime Error - Need Advice
> 
> 
>   
> 
> 
> Caterpillar: Confidential GreenRetain Until: 03/11/2010
> 
> 
> 
> 
> Use pylab.savefig('log_plot'). Also saving the figure to file and
> showing it interactively in the same script might involve switching
> backends, which might not work as expected.
> 
> It is advisable to downgrade to numpy 1.3.
> 
> -- Christoph
> 
> On 2/9/2010 10:44 AM, Lee Boger wrote:
>>
>> Although, if I close the figure then re-run the script, a new figure
>> pops up but it doesn't have any data plotted. Interpreter is now locked
>> up. I'm still not fixing it completely. There is also no figure stored
>> as a file log_plot.
>>
>> Lee
>>
>>
>> *Christoph Gohlke *
>>
>> 02/09/2010 01:23 PM
>>
>>  
>> To
>>  Lee Boger 
>> cc
>>  
>> Subject
>>  Re: [Matplotlib-users] Runtime Error - Need Advice
>>
>>
>>  
>>
>>
>> Caterpillar: Confidential GreenRetain Until: 03/11/2010
>>
>>
>>
>>
>> Change the last line to pylab.show() and it should work.
>>
>> Anyway, this example should not crash the interpreter. I can reproduce
>> the crash on Python 2.4, 2.5, and 2.6 (32 and 64 bit) on Windows with
>> mpl 0.99.1 but not on Ubuntu 9.1 with mpl 0.99.0.
>>
>> The shortest example that crashes is:
>>
>> python -c "import pylab;pylab.subplot(111).figure.show()"
>>
>> or on the interactive prompt:
>>
>>>>> import pylab
>>>>> pylab.subplot(111).figure.show()
>>>>> exit()
>> Fatal Python error: PyEval_RestoreThread: NULL tstate
>>
>> This application has requested the Runtime to terminate it in an unusual
>> way.
>> Please contact the application's support team for more information.
>>
>>
>> -- Christoph
>>
>> On 2/9/2010 7:57 AM, Lee Boger wrote:
>>>
>>> Windows XP Professional with Python 2.5 installed (pywin32 build 210) -
>>> came with dSPACE software package
>>>
>>> Downloaded and installed matplotlib-0.99.1.win32-py2.5.exe from
>>> sourceforge.net
>>>
>>> Downloaded and installed numpy-1.4.0-win32-superpack-python2.5.exe from
>>> sourceforge.net
>>>
>>> Executing the following simple "log plot" script within PythonWin:
>>>
>>> *from* matplotlib *import* pylab
>>>
>>> # Create some artificial data.
>>> test_frequency = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
>>> 17, 18, 19, 20]
>>> test_results = [-0.2, -0.7, -1.0, -1.5, -2.0, -2.5, -3.0, -3.5, -4, -5,
>>> -6, -7.1, -8, -9, -10, -11, -12, -15, -20, -25]
>>> spec_frequency = [6, 8]
>>> spec_results = [-3.0, -3.0]
>>>
>>> # Plot
>>> figure = pylab.subplot(111)
>>> figure.semilogx()
>>> figure.scatter(test_frequency, test_results, s=20, c='b', marker='s',
>>> edgecolors='none')
>>> figure.scatter(spec_frequency, spec_results, s=40, c=

Re: [Matplotlib-users] Runtime Error - Need Advice

2010-02-09 Thread Lee Boger
Thanks for your help. I'll look into ipython.

Lee



Eric Firing  
02/09/2010 02:31 PM

To
Lee Boger , matplotlib-users 

cc

Subject
Re: [Matplotlib-users] Runtime Error - Need Advice




Caterpillar: Confidential Green Retain Until: 03/11/2010 



Lee Boger wrote:
> 
> Thanks for the quick feedback. I changed the last line from 
> figure.figure.show() to pyplot.show() and it worked without crashing the 

> interpreter. However, if I close the figure then re-run the script, a 
> new figure pops up but it doesn't have any data plotted. Interpreter is 
> now locked up, the run-time error occurred and no figure stored as a 
> file log_plot. I un-installed numpy-1.4.0 and installed numpy-1.3.0, but 

> the results were as I just described.
> 
> Lee
> 


At this point a Windows user may need to step in.  I know nothing about 
PythonWin.  My suspicion is that this is a problem of dueling event 
loops, and one solution would be to use ipython instead of pythonwin.

(Note that you typically need to use "reply to all" on this list, 
otherwise the reply does not get copied to the list.)

Eric

> 
> 
> *Eric Firing *
> 
> 02/09/2010 01:35 PM
> 
> 
> To
>Lee Boger 
> cc
>    matplotlib-users@lists.sourceforge.net
> Subject
>Re: [Matplotlib-users] Runtime Error - Need Advice
> 
> 
> 
> 
> 
> Caterpillar: Confidential GreenRetain Until: 03/11/2010 
> 
> 
> 
> 
> Lee Boger wrote:
>  >
>  > Windows XP Professional with Python 2.5 installed (pywin32 build 210) 
-
>  > came with dSPACE software package
>  >
>  > Downloaded and installed matplotlib-0.99.1.win32-py2.5.exe from
>  > sourceforge.net
>  >
>  > Downloaded and installed numpy-1.4.0-win32-superpack-python2.5.exe 
from
>  > sourceforge.net
> 
> I suspect this is the problem: numpy-1.4.0 is considered broken and has
> been withdrawn.  Specifically, it introduces binary incompatibility with
> programs compiled against prior versions of numpy, including matplotlib.
> If you go back to the numpy sourceforge site now, I think you will see
> an earlier version that you can install in place of 1.4.0 (after
> removing the latter).
> 
> Eric
> 
>  >
>  > Executing the following simple "log plot" script within PythonWin:
>  >
>  > *from* matplotlib *import* pylab
>  >
>  > # Create some artificial data.
>  > test_frequency = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 
16,
>  > 17, 18, 19, 20]
>  > test_results = [-0.2, -0.7, -1.0, -1.5, -2.0, -2.5, -3.0, -3.5, -4, 
-5,
>  > -6, -7.1, -8, -9, -10, -11, -12, -15, -20, -25]
>  > spec_frequency = [6, 8]
>  > spec_results = [-3.0, -3.0]
>  >
>  > # Plot
>  > figure = pylab.subplot(111)
>  > figure.semilogx()
>  > figure.scatter(test_frequency, test_results, s=20, c='b', marker='s',
>  > edgecolors='none')
>  > figure.scatter(spec_frequency, spec_results, s=40, c='g', marker='s',
>  > edgecolors='none')
>  > figure.grid(True)
>  > figure.set_xlabel(r"Frequency (Hz)", fontsize = 12)
>  > figure.set_ylabel(r"Actuator Response (db)", fontsize = 12)
>  >
>  > figure.figure.savefig('log_plot')
>  > figure.figure.show()
>  >
>  >
>  > Plots a figure on the screen that looks correct, then the following
>  > error (when I click OK, PythonWin closes)
>  >
>  >
>  >
>  > Any advice would be appreciated. Maybe it's an installation or setup
>  > issue, but I'm pretty knew to Python programming and don't know how 
to
>  > debug this.
>  >
>  > Lee Boger
> 


--
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Runtime Error - Need Advice

2010-02-09 Thread Eric Firing
Lee Boger wrote:
> 
> Thanks for the quick feedback. I changed the last line from 
> figure.figure.show() to pyplot.show() and it worked without crashing the 
> interpreter. However, if I close the figure then re-run the script, a 
> new figure pops up but it doesn't have any data plotted. Interpreter is 
> now locked up, the run-time error occurred and no figure stored as a 
> file log_plot. I un-installed numpy-1.4.0 and installed numpy-1.3.0, but 
> the results were as I just described.
> 
> Lee
> 


At this point a Windows user may need to step in.  I know nothing about 
PythonWin.  My suspicion is that this is a problem of dueling event 
loops, and one solution would be to use ipython instead of pythonwin.

(Note that you typically need to use "reply to all" on this list, 
otherwise the reply does not get copied to the list.)

Eric

> 
> 
> *Eric Firing *
> 
> 02/09/2010 01:35 PM
> 
>   
> To
>   Lee Boger 
> cc
>   matplotlib-users@lists.sourceforge.net
> Subject
>   Re: [Matplotlib-users] Runtime Error - Need Advice
> 
> 
>   
> 
> 
> Caterpillar: Confidential GreenRetain Until: 03/11/2010
> 
> 
> 
> 
> Lee Boger wrote:
>  >
>  > Windows XP Professional with Python 2.5 installed (pywin32 build 210) -
>  > came with dSPACE software package
>  >
>  > Downloaded and installed matplotlib-0.99.1.win32-py2.5.exe from
>  > sourceforge.net
>  >
>  > Downloaded and installed numpy-1.4.0-win32-superpack-python2.5.exe from
>  > sourceforge.net
> 
> I suspect this is the problem: numpy-1.4.0 is considered broken and has
> been withdrawn.  Specifically, it introduces binary incompatibility with
> programs compiled against prior versions of numpy, including matplotlib.
> If you go back to the numpy sourceforge site now, I think you will see
> an earlier version that you can install in place of 1.4.0 (after
> removing the latter).
> 
> Eric
> 
>  >
>  > Executing the following simple "log plot" script within PythonWin:
>  >
>  > *from* matplotlib *import* pylab
>  >
>  > # Create some artificial data.
>  > test_frequency = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
>  > 17, 18, 19, 20]
>  > test_results = [-0.2, -0.7, -1.0, -1.5, -2.0, -2.5, -3.0, -3.5, -4, -5,
>  > -6, -7.1, -8, -9, -10, -11, -12, -15, -20, -25]
>  > spec_frequency = [6, 8]
>  > spec_results = [-3.0, -3.0]
>  >
>  > # Plot
>  > figure = pylab.subplot(111)
>  > figure.semilogx()
>  > figure.scatter(test_frequency, test_results, s=20, c='b', marker='s',
>  > edgecolors='none')
>  > figure.scatter(spec_frequency, spec_results, s=40, c='g', marker='s',
>  > edgecolors='none')
>  > figure.grid(True)
>  > figure.set_xlabel(r"Frequency (Hz)", fontsize = 12)
>  > figure.set_ylabel(r"Actuator Response (db)", fontsize = 12)
>  >
>  > figure.figure.savefig('log_plot')
>  > figure.figure.show()
>  >
>  >
>  > Plots a figure on the screen that looks correct, then the following
>  > error (when I click OK, PythonWin closes)
>  >
>  >
>  >
>  > Any advice would be appreciated. Maybe it's an installation or setup
>  > issue, but I'm pretty knew to Python programming and don't know how to
>  > debug this.
>  >
>  > Lee Boger
> 


--
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Runtime Error - Need Advice

2010-02-09 Thread Christoph Gohlke
Use pylab.savefig('log_plot'). Also saving the figure to file and
showing it interactively in the same script might involve switching
backends, which might not work as expected.

It is advisable to downgrade to numpy 1.3.

-- Christoph

On 2/9/2010 10:44 AM, Lee Boger wrote:
> 
> Although, if I close the figure then re-run the script, a new figure
> pops up but it doesn't have any data plotted. Interpreter is now locked
> up. I'm still not fixing it completely. There is also no figure stored
> as a file log_plot.
> 
> Lee
> 
> 
> *Christoph Gohlke *
> 
> 02/09/2010 01:23 PM
> 
>   
> To
>       Lee Boger 
> cc
>   
> Subject
>   Re: [Matplotlib-users] Runtime Error - Need Advice
> 
> 
>   
> 
> 
> Caterpillar: Confidential GreenRetain Until: 03/11/2010
> 
> 
> 
> 
> Change the last line to pylab.show() and it should work.
> 
> Anyway, this example should not crash the interpreter. I can reproduce
> the crash on Python 2.4, 2.5, and 2.6 (32 and 64 bit) on Windows with
> mpl 0.99.1 but not on Ubuntu 9.1 with mpl 0.99.0.
> 
> The shortest example that crashes is:
> 
> python -c "import pylab;pylab.subplot(111).figure.show()"
> 
> or on the interactive prompt:
> 
>>>> import pylab
>>>> pylab.subplot(111).figure.show()
>>>> exit()
> Fatal Python error: PyEval_RestoreThread: NULL tstate
> 
> This application has requested the Runtime to terminate it in an unusual
> way.
> Please contact the application's support team for more information.
> 
> 
> -- Christoph
> 
> On 2/9/2010 7:57 AM, Lee Boger wrote:
>>
>> Windows XP Professional with Python 2.5 installed (pywin32 build 210) -
>> came with dSPACE software package
>>
>> Downloaded and installed matplotlib-0.99.1.win32-py2.5.exe from
>> sourceforge.net
>>
>> Downloaded and installed numpy-1.4.0-win32-superpack-python2.5.exe from
>> sourceforge.net
>>
>> Executing the following simple "log plot" script within PythonWin:
>>
>> *from* matplotlib *import* pylab
>>
>> # Create some artificial data.
>> test_frequency = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
>> 17, 18, 19, 20]
>> test_results = [-0.2, -0.7, -1.0, -1.5, -2.0, -2.5, -3.0, -3.5, -4, -5,
>> -6, -7.1, -8, -9, -10, -11, -12, -15, -20, -25]
>> spec_frequency = [6, 8]
>> spec_results = [-3.0, -3.0]
>>
>> # Plot
>> figure = pylab.subplot(111)
>> figure.semilogx()
>> figure.scatter(test_frequency, test_results, s=20, c='b', marker='s',
>> edgecolors='none')
>> figure.scatter(spec_frequency, spec_results, s=40, c='g', marker='s',
>> edgecolors='none')
>> figure.grid(True)
>> figure.set_xlabel(r"Frequency (Hz)", fontsize = 12)
>> figure.set_ylabel(r"Actuator Response (db)", fontsize = 12)
>>
>> figure.figure.savefig('log_plot')
>> figure.figure.show()
>>
>>
>> Plots a figure on the screen that looks correct, then the following
>> error (when I click OK, PythonWin closes)
>>
>>
>>
>> Any advice would be appreciated. Maybe it's an installation or setup
>> issue, but I'm pretty knew to Python programming and don't know how to
>> debug this.
>>
>> Lee Boger
>>
>>
>>
>> --
>> The Planet: dedicated and managed hosting, cloud storage, colocation
>> Stay online with enterprise data centers and the best network in the
> business
>> Choose flexible plans and management services without long-term contracts
>> Personal 24x7 support from experience hosting pros just a phone call away.
>> http://p.sf.net/sfu/theplanet-com
>>
>>
>>
>> ___
>> Matplotlib-users mailing list
>> Matplotlib-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 

--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Runtime Error - Need Advice

2010-02-09 Thread Eric Firing
Lee Boger wrote:
> 
> Windows XP Professional with Python 2.5 installed (pywin32 build 210) - 
> came with dSPACE software package
> 
> Downloaded and installed matplotlib-0.99.1.win32-py2.5.exe from 
> sourceforge.net
> 
> Downloaded and installed numpy-1.4.0-win32-superpack-python2.5.exe from 
> sourceforge.net

I suspect this is the problem: numpy-1.4.0 is considered broken and has 
been withdrawn.  Specifically, it introduces binary incompatibility with 
programs compiled against prior versions of numpy, including matplotlib.
If you go back to the numpy sourceforge site now, I think you will see 
an earlier version that you can install in place of 1.4.0 (after 
removing the latter).

Eric

> 
> Executing the following simple "log plot" script within PythonWin:
> 
> *from* matplotlib *import* pylab
> 
> # Create some artificial data.
> test_frequency = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 
> 17, 18, 19, 20]
> test_results = [-0.2, -0.7, -1.0, -1.5, -2.0, -2.5, -3.0, -3.5, -4, -5, 
> -6, -7.1, -8, -9, -10, -11, -12, -15, -20, -25]
> spec_frequency = [6, 8]
> spec_results = [-3.0, -3.0]
> 
> # Plot
> figure = pylab.subplot(111)
> figure.semilogx()
> figure.scatter(test_frequency, test_results, s=20, c='b', marker='s', 
> edgecolors='none')
> figure.scatter(spec_frequency, spec_results, s=40, c='g', marker='s', 
> edgecolors='none')
> figure.grid(True)
> figure.set_xlabel(r"Frequency (Hz)", fontsize = 12)
> figure.set_ylabel(r"Actuator Response (db)", fontsize = 12)
> 
> figure.figure.savefig('log_plot')
> figure.figure.show()
> 
> 
> Plots a figure on the screen that looks correct, then the following 
> error (when I click OK, PythonWin closes)
> 
> 
> 
> Any advice would be appreciated. Maybe it's an installation or setup 
> issue, but I'm pretty knew to Python programming and don't know how to 
> debug this.
> 
> Lee Boger

--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Runtime Error - Need Advice

2010-02-09 Thread Christoph Gohlke
Change the last line to pylab.show() and it should work.

Anyway, this example should not crash the interpreter. I can reproduce
the crash on Python 2.4, 2.5, and 2.6 (32 and 64 bit) on Windows with
mpl 0.99.1 but not on Ubuntu 9.1 with mpl 0.99.0.

The shortest example that crashes is:

python -c "import pylab;pylab.subplot(111).figure.show()"

or on the interactive prompt:

>>> import pylab
>>> pylab.subplot(111).figure.show()
>>> exit()
Fatal Python error: PyEval_RestoreThread: NULL tstate

This application has requested the Runtime to terminate it in an unusual
way.
Please contact the application's support team for more information.


-- Christoph

On 2/9/2010 7:57 AM, Lee Boger wrote:
> > 
> > Windows XP Professional with Python 2.5 installed (pywin32 build 210) -
> > came with dSPACE software package
> > 
> > Downloaded and installed matplotlib-0.99.1.win32-py2.5.exe from
> > sourceforge.net
> > 
> > Downloaded and installed numpy-1.4.0-win32-superpack-python2.5.exe from
> > sourceforge.net
> > 
> > Executing the following simple "log plot" script within PythonWin:
> > 
> > *from* matplotlib *import* pylab
> > 
> > # Create some artificial data.
> > test_frequency = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
> > 17, 18, 19, 20]
> > test_results = [-0.2, -0.7, -1.0, -1.5, -2.0, -2.5, -3.0, -3.5, -4, -5,
> > -6, -7.1, -8, -9, -10, -11, -12, -15, -20, -25]
> > spec_frequency = [6, 8]
> > spec_results = [-3.0, -3.0]
> > 
> > # Plot
> > figure = pylab.subplot(111)
> > figure.semilogx()
> > figure.scatter(test_frequency, test_results, s=20, c='b', marker='s',
> > edgecolors='none')
> > figure.scatter(spec_frequency, spec_results, s=40, c='g', marker='s',
> > edgecolors='none')
> > figure.grid(True)
> > figure.set_xlabel(r"Frequency (Hz)", fontsize = 12)
> > figure.set_ylabel(r"Actuator Response (db)", fontsize = 12)
> > 
> > figure.figure.savefig('log_plot')
> > figure.figure.show()
> > 
> > 
> > Plots a figure on the screen that looks correct, then the following
> > error (when I click OK, PythonWin closes)
> > 
> > 
> > 
> > Any advice would be appreciated. Maybe it's an installation or setup
> > issue, but I'm pretty knew to Python programming and don't know how to
> > debug this.
> > 
> > Lee Boger


--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Runtime Error - Need Advice

2010-02-09 Thread Lee Boger
Windows XP Professional with Python 2.5 installed (pywin32 build 210) - 
came with dSPACE software package

Downloaded and installed matplotlib-0.99.1.win32-py2.5.exe from 
sourceforge.net

Downloaded and installed numpy-1.4.0-win32-superpack-python2.5.exe from 
sourceforge.net

Executing the following simple "log plot" script within PythonWin:

from matplotlib import pylab

# Create some artificial data.
test_frequency = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 
17, 18, 19, 20]
test_results = [-0.2, -0.7, -1.0, -1.5, -2.0, -2.5, -3.0, -3.5, -4, -5, 
-6, -7.1, -8, -9, -10, -11, -12, -15, -20, -25]
spec_frequency = [6, 8]
spec_results = [-3.0, -3.0]

# Plot
figure = pylab.subplot(111)
figure.semilogx()
figure.scatter(test_frequency, test_results, s=20, c='b', marker='s', 
edgecolors='none')
figure.scatter(spec_frequency, spec_results, s=40, c='g', marker='s', 
edgecolors='none')
figure.grid(True)
figure.set_xlabel(r"Frequency (Hz)", fontsize = 12)
figure.set_ylabel(r"Actuator Response (db)", fontsize = 12)

figure.figure.savefig('log_plot')
figure.figure.show()


Plots a figure on the screen that looks correct, then the following error 
(when I click OK, PythonWin closes)



Any advice would be appreciated. Maybe it's an installation or setup 
issue, but I'm pretty knew to Python programming and don't know how to 
debug this.

Lee Boger<>--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Runtime Error from savefig( )

2010-01-14 Thread Echavarria Gregory, Maria Angelica
Good afternoon group,

I am developing an application that had always before plotted a variable 2D 
numpy array of floats using contourf(), and then saved the figure produced as 
.png. Certain runs of the application (the ones with best precision) result in 
a failure while saving the figure using savefig(), and as consequence the 
message says at the end: "Runtime Error: Failure to gain raw access to bitmap 
data", here is the complete complaint, does someone know what is happening 
please?
I use windows machines and Python 2.5.4.

Traceback (most recent call last):

File 
"C:/OSGeo4W/apps/Python25/Scripts/Jan_7_2010/SOMangelCalculationClassesOption2NoComparison.py"
 , line 667 in CalculateCG:
  savefig(fname, dpi=600, facecolor='w', edgecolor='w', 
orientation='portrait', papertype=None, format=None, transparent=False)



File "C:/OSGeo4W/apps/Python25/Lib/site-packages/matplotlib/pyplot.py", line 
269, in savefig

  return fig.savefig(*args, **kwargs)



File "C:/OSGeo4W/apps/Python25/Lib/site-packages/matplotlib/figure.py", line 
782, in savefig

  self.canvas.print_figure(*args, **kwargs)



File 
"C:/OSGeo4W/apps/Python25/Lib/site-packages/matplotlib/backends/backend_wxagg.py",
 line 101, in print_figure

  FigureCanvasAgg.print_figure(self, filename, *args, **kwargs)



File "C:/OSGeo4W/apps/Python25/Lib/site-packages/matplotlib/backend_bases.py", 
line 1195, in print_figure

  **kwargs)



File 
"C:/OSGeo4W/apps/Python25/Lib/site-packages/matplotlib/backends/backend_agg.py"),
 line 396, in print_png

  self.draw()



File 
"C:/OSGeo4W/apps/Python25/Lib/site-packages/matplotlib/backends/backend_wxagg.py",
 line 63, in draw

  self.bitmap = _convert_agg_to_wx_bitmap(self.get_renderer(), None)



File 
"C:/OSGeo4W/apps/Python25/Lib/site-packages/matplotlib/backends/backend_wxagg.py",
 line 226, in _py_WX28_convert_agg_to_wx_bitmap

  agg.buffer_rgba(0,0))



File 
"C:/OSGeo4W/apps/Python25/Lib/site-packages/wx-2.8-msw-unicode\wx\_gdi.py", 
line 889, in BitmapFromBufferRGBA

  return _gdi_._BitmapFromBufferRGBA(width, height, dataBuffer)

  RuntimeError: Failed to gain raw access to bitmap data.




M. Angelica Echavarria-Gregory, M.Sc., E.I.
Ph.D Candidate
University of Miami
Phone 305 284-3611

--
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Runtime Error

2008-03-25 Thread Darren Dale
On Monday 24 March 2008 01:52:27 pm Brook Lin wrote:
> After installation, I only ran a simple code attached below. I found that I
> got this run time error from "from pylab import *".
>
> I did go through what Mark Hamilton posted:
> Index: cutils.py
> ===
> --- cutils.py (revision 5001)
> +++ cutils.py (working copy)
> @@ -79,7 +79,7 @@
>  raise RuntimeError("""\
>  '%s' is not a writable dir; you must set %s/.matplotlib to be a writable
> dir.
>  You can also set environment variable MPLCONFIGDIR to any writable
> directory
> -where you want matplotlib data stored """%h)
> +where you want matplotlib data stored """%(p,h))
>  else:
>  if not is_writable_dir(h):
>  raise RuntimeError("Failed to create %s/.matplotlib; consider
> setting MPLCONFIGDIR to a writable directory for matplotlib configuration
> data"%h)
>
> I changed where you want matplotlib data stored """%h) into where you want
> matplotlib data stored """%(p,h)). However, I got the same error after
> changes. Did I do right?

Sorry, cutils.py is a part of a new config package we have been working on, 
which ships with matplotlib but is not activated. I think you need to edit 
your matplotlib/__init__.py instead, just make the same changes.

Once that change is made, and you try to import pylab, you should get a 
RunTimeError telling you that matplotlib can't create the directory, either 
because the path doesnt exist, or it exists but you cant write to it. At that 
point you can set your MPLCONFIGDIR environment variable to point somewhere 
writeable, and if it seems like a bug that matplotlib is trying to create a 
directory somewhere nonsensical, please let us know.

> I install matplotlib by:
> python setup.py build
> python setup.py install
> How can I install it by svn trunk?

The following should be on one line:


svn co 
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/matplotlib 
matplotlib


then cd into the new directory and install in the usual way.

Darren

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Runtime Error

2008-03-24 Thread Brook Lin

After installation, I only ran a simple code attached below. I found that I
got this run time error from "from pylab import *".

I did go through what Mark Hamilton posted:
Index: cutils.py
===
--- cutils.py (revision 5001)
+++ cutils.py (working copy)
@@ -79,7 +79,7 @@
 raise RuntimeError("""\
 '%s' is not a writable dir; you must set %s/.matplotlib to be a writable
dir.
 You can also set environment variable MPLCONFIGDIR to any writable
directory
-where you want matplotlib data stored """%h)
+where you want matplotlib data stored """%(p,h))
 else:
 if not is_writable_dir(h):
 raise RuntimeError("Failed to create %s/.matplotlib; consider
setting MPLCONFIGDIR to a writable directory for matplotlib configuration
data"%h) 

I changed where you want matplotlib data stored """%h) into where you want
matplotlib data stored """%(p,h)). However, I got the same error after
changes. Did I do right? 

I install matplotlib by:
python setup.py build
python setup.py install
How can I install it by svn trunk?

Appreciated,
Brook

=
from pylab import *
from matplotlib import *
from pylab import figure, close, show, nx
from matplotlib.figure import Figure
import time

x=arange(10)
y=[2, 4, 6, 8, 10, 12, 14, 16, 18, 20]
x2=arange(20)
y2=arange(20)

f=figure()   
hold(True)
plot(x,y)
plot(x2,y2)
grid()
pylab.show()
time.sleep(3)
pylab.close(f)
===
-- 
View this message in context: 
http://www.nabble.com/Runtime-Error-tp16239554p16257231.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Runtime Error

2008-03-24 Thread Chris Withers
Hi Brook,

Brook Lin wrote:
> raise RuntimeError("'%s' is not a writable dir; you must set
> %s/.matplotlib to be a writable dir.  You can also set environment variable
> MPLCONFIGDIR to any writable directory where you want matplotlib data stored
> "%h)

This is the crucial bit.

Looks like you've set MPLCONFIGDIR to a read-only dir, or the 
.matplotlib in the current dir or .matplotlib in your home directory 
aren't writeable by the user running your python script. (I'm doing a 
bit of guesswork here...)

What is it that you're trying to do?

cheers,

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
- http://www.simplistix.co.uk

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Runtime Error

2008-03-23 Thread John Hunter
On Sun, Mar 23, 2008 at 8:51 PM, Darren Dale <[EMAIL PROTECTED]> wrote:

>  > raise RuntimeError("'%s' is not a writable dir; you must set
>  > %s/.matplotlib to be a writable dir.  You can also set environment variable
>  > MPLCONFIGDIR to any writable directory where you want matplotlib data
>  > stored "%h)
>  > TypeError: not enough arguments for format string
>  >
>  > How can I get it fixed?
>
>  We might be in a better position to help if you post the example code.

This bug was first pointed out by Mark Hamilton (with a patch) in the
thread "RuntimeError in _get_configdir".  I've committed his fix to
svn.  Basically, the format string is looking for two arguments where
only one is provided.  Because it only arises in an error condition,
it is a corner of the code that had not been hit before.

JDH

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Runtime Error

2008-03-23 Thread Darren Dale
On Sunday 23 March 2008 2:23:36 pm Brook Lin wrote:
> Hi All,
>
> I installed the matplotlib0.91.2 on 64-bit Ubuntu7.04 system. I ran an
> example code and got the error:
>
>   File "testplot.py", line 2, in 
> from pylab import *
>   File "/usr/lib/python2.5/site-packages/pylab.py", line 1, in 
> from matplotlib.pylab import *
>   File "/usr/lib/python2.5/site-packages/matplotlib/__init__.py", line 639,
> in 
> rcParams = rc_params()
>   File "/usr/lib/python2.5/site-packages/matplotlib/__init__.py", line 562,
> in rc_params
> fname = matplotlib_fname()
>   File "/usr/lib/python2.5/site-packages/matplotlib/__init__.py", line 513,
> in matplotlib_fname
> fname = os.path.join(get_configdir(), 'matplotlibrc')
>   File "/usr/lib/python2.5/site-packages/matplotlib/__init__.py", line 207,
> in wrapper
> ret = func(*args, **kwargs)
>   File "/usr/lib/python2.5/site-packages/matplotlib/__init__.py", line 400,
> in _get_configdir
> raise RuntimeError("'%s' is not a writable dir; you must set
> %s/.matplotlib to be a writable dir.  You can also set environment variable
> MPLCONFIGDIR to any writable directory where you want matplotlib data
> stored "%h)
> TypeError: not enough arguments for format string
>
> How can I get it fixed?

We might be in a better position to help if you post the example code.

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] runtime error - IGNORE

2007-09-18 Thread Daniel Fish
Please ignore this question...


  - Original Message - 
  From: Daniel Fish 
  To: Matplotlib-users@lists.sourceforge.net 
  Sent: Tuesday, September 18, 2007 11:21 AM
  Subject: [Matplotlib-users] runtime error


  Could anyone explain why I get a runtime error when using pylab.ion? (see 
below)
  I am running the latest version of matplotlib on Python 2.5 (windows)

  Thanks,

  Daniel Fish


  #---Offending code
  import pylab

  pylab.ion()
  pylab.plot(range(10))
  #-

  Error Message:

  Runtime Error! 
  Program: C:\Python25\pythonw.exe


--


  -
  This SF.net email is sponsored by: Microsoft
  Defy all challenges. Microsoft(R) Visual Studio 2005.
  http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/


--


  ___
  Matplotlib-users mailing list
  Matplotlib-users@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/matplotlib-users
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] runtime error

2007-09-18 Thread Daniel Fish
Could anyone explain why I get a runtime error when using pylab.ion? (see below)
I am running the latest version of matplotlib on Python 2.5 (windows)

Thanks,

Daniel Fish


#---Offending code
import pylab

pylab.ion()
pylab.plot(range(10))
#-

Error Message:

Runtime Error! 
Program: C:\Python25\pythonw.exe-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Runtime Error on running matplotlib examples pythonic_matplotlib.py, cursor_demo.py, etc .. (Pythonwin 2.4 crashes)

2006-12-27 Thread maser rati
Hi Guys,

I'm a new user of Matplotlib and am very impressed by its plotting capabilities.

I have the latest version of Matplotlib and Numpy 1.0 running on my Win 2000 
system with Python 2.4. 

On running the pythonic_matplotlib.py,cursor_demo.py etc.. in Matplotlib 
examples in the Pythonwin interpreter, the program runs fine, the tk window 
shows up and when I close the window by way of the 'x' on the right hand side, 
it closes fine.

But however, when I reload pythonic_matplotlib.py, and run it again (by 
pressing F5), the tk window shows up, but the all the functions on the toolbar 
do not work. When I press the 'x' on the right hand side of the window, it 
shows the following message and Pythonwin crashes.

"Runtime Error!

Program: c:\Python24\Lib\site-packages\pythonwin\pythonwin.exe

This application has requested the Runtime to terminate in an unusual way. 
Please contact the application's support team for more information"

I was wondering what the issue could be.

Your response is greatly appreciated.

Thanks.
Maser



 
-
Cheap Talk? Check out Yahoo! Messenger's low PC-to-Phone call rates.-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users