···
From: Jeff Whitaker <jswhit@…146…>
To: matplotlib-users@…1738…net
Cc: rawlins02@…83…9…
Sent: Thursday, September 13, 2012 9:44 PM
Subject: Re: [Matplotlib-users] error installing basemap
On 9/13/12 2:34 PM, Michael Rawlins wrote:
From: Michael
Droettboom <mdroe@…86…>
To:
matplotlib-users@lists.sourceforge.net
Sent: Thursday, September
13, 2012 2:09 PM
Subject: Re:
[Matplotlib-users] error installing basemap
You need to also install the python
development package (python-dev), which
contains the headers.
Mike
From: Michael
Rawlins <rawlins02@…9…>
To: Michael Droettboom
<mdroe@…86…> ;
“matplotlib-users@lists.sourceforge.net”
matplotlib-users@lists.sourceforge.net
**Sent:** Thursday,
September 13, 2012 3:11 PM
Subject: Re:
[Matplotlib-users] error installing basemap
ailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
OK basemap installed. Thanks. But I'm
getting an error running a script that
worked with previous installation(s) of
python, matplotlib, and basemap. The error:
user@...4200...:~>python [map2_TempDiff_4panels.py](http://map2_tempdiff_4panels.py/)
Traceback (most recent call last):
File "map2_TempDiff_4panels.py", line 27,
in
from mpl_toolkits.basemap import
NetCDFFile
ImportError: cannot import name NetCDFFile
I installed python-mpltoolkits.basemap from
package manager, before testing my script.
MR
An update: My test script, which works with
previously, now gets past the header
initializations. Here they are:
import sys,getopt
from mpl_toolkits.basemap import Basemap,
shiftgrid, cm
#from mpl_toolkits.basemap import
NetCDFFile
from [Scientific.IO](http://scientific.io.net/).NetCDF import NetCDFFile
from pylab import *
import matplotlib.pyplot as plt
Notr clear why the first import NetCDFFile
statement does not work. Farther down the
script, the code stops on this statement:
data.missing_value=-9.99
There error to standard output:
Traceback (most recent call last):
File "map2_TempDiff_4panels.py", line 266,
in
data.missing_value=-9.99
IOError: netcdf: write access to read-only
file
Michael: The NetCDFFile function was deprecated a few releases
back, and recently removed. If you have netcdf4-python installed
you can do
from netCDF4 import Dataset as NetCDFFile
and the script should work as before.
Regarding the second error, you must open the file for write access
(mode=‘w’) if you want to add attributes to the data variables.
-Jeff
Jeff,
No I don’t have netCDF4 installed. It’s not in the package manager. Wasn’t sure if there would be a conflict with python-netcdf that’s installed. Guess that’s the reverse interface. Now I’m having some trouble compiling netcdf4-python from sources following:
http://code.google.com/p/netcdf4-python/wiki/UbuntuInstall
The configure ended in error:
checking whether the C compiler works… no
configure: error: in `/home/rawlins/Downloads/netcdf-4.2.1.1’:
configure: error: C compiler cannot create executables
Mike