matplotlib runtime errors after installing Ubuntu 16.04

            I have matplotlib installed via sudo apt-get install on Ubuntu
16.04 and when I run my old scripts(developed on Ubuntu 14.04) I get this
run time error . I do have basemap installed as well as pyproj using sudo

Traceback (most recent call last):File "", line 30, in <module>
x,y = m(lons,lats)File
line 1148, in __call__
xout,yout = self.projtran(x,y,inverse=inverse)sys.exit()
File "/usr/lib/python3/dist-packages/mpl_toolkits/basemap/",
line 286, in __call__
  outx,outy = self._proj4(x, y, inverse=inverse)
  File "/usr/lib/python3/dist-packages/mpl_toolkits/basemap/",
line 392, in __call__
_proj.Proj._fwd(self, inx, iny, radians=radians, errcheck=errcheck)
File "_proj.pyx", line 122, in _proj.Proj._fwd (src/_proj.c:1571)
SystemError: <class 'RuntimeError'> returned a result with an error set

This is the code I am running

nc_f = './'
nc_fid = Dataset(nc_f, 'r')
                         # and create an instance of the ncCDF4 class
lats = nc_fid.variables['lat'][:] # extract/copy the data

lons = nc_fid.variables['lon'][:]

time = nc_fid.variables['time'][:]
hgt = nc_fid.variables['hgt'][:]

m = Basemap(width=5000000,height=3500000,
resolution='l',projection='stere', lat_0 = 0, lon_0 = 0, lat_ts = 40)

lons,lats = np.meshgrid(lons, lats,copy=False)

  x,y = m(lons,lats) <----- CODE FAILS HERE


Any thoughts ?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>