[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 on Solaris - Error Closing Dupe File Handle

2015-05-28 Thread Bryan Williams
nclude/sys/stdint.h:17,
 from /usr/include/stdint.h:17,
 from
/opt/csw/lib/gcc/sparc-sun-solaris2.10/4.9.2/include/stdint.h:9,
 from src/mplutils.h:11,
 from src/ft2font_wrapper.cpp:1:
/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
 ^
In file included from /usr/local/include/python3.4m/Python.h:36:0,
 from src/mplutils.h:21,
 from src/ft2font_wrapper.cpp:1:
/usr/include/unistd.h:496:75: error: conflicting declaration of C function
'void swab(const void*, void*, ssize_t)'
 extern void swab(const void *_RESTRICT_KYWD, void *_RESTRICT_KYWD,
ssize_t);
   ^
In file included from /usr/local/include/python3.4m/Python.h:34:0,
 from src/mplutils.h:21,
 from src/ft2font_wrapper.cpp:1:
/usr/include/stdlib.h:144:13: note: previous declaration 'void swab(const
char*, char*, ssize_t)'
 extern void swab(const char *, char *, ssize_t);
 ^
error: command 'gcc' failed with exit status 1


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.

Thanks again for all you do, and thanks for the help.

-- BMW

On Sun, May 24, 2015 at 2:05 PM, Thomas Caswell  wrote:

> 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 <
> 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", "cr

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] Matplotlib import Error

2015-06-07 Thread Bryan Williams
If you have pip installed, installing six is simple:

pip install six

Hope that helps! :)

On 6/7/2015 3:57 PM, aureta wrote:
> Hi, I had Matplotlib installed and working in my PC. I decided to uninstall
> it using the control panel software uninstall option and install it again.
>   This time when I run the VIDLE using the import matplot.pyplot as plt
>   sentence I get the following message:
>
> Python 2.7.10 (default, May 23 2015, 09:40:32) [MSC v.1500 32 bit (Intel)]
> on win32
> Type "copyright", "credits" or "license()" for more information.
  RESTART
 

> Traceback (most recent call last):
>File "Untitled", line 1
>  import matplotlib.pyplot as plt
>File "C:\Python27\Lib\site-packages\matplotlib\__init__.py", line 105
>  import six
> ImportError: No module named six
>
>
> --
> View this message in context: 
> http://matplotlib.1069221.n5.nabble.com/Matplotlib-import-Error-tp45741.html
> Sent from the matplotlib - users mailing list archive at Nabble.com.
>
> --
> ___
> 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