0

I am trying to work with the "oceansdb" package, and as a dependency it requires netCDF4. When I try to run anything related to oceansdb, I get an error:


  File "C:/Users/Documents/starter.py", line 12, in <module>
    import oceansdb

  File "C:\Users\Anaconda3-64bit\lib\site-packages\oceansdb\__init__.py", line 8, in <module>
    from oceansdb.woa import WOA

  File "C:\Users\Anaconda3-64bit\lib\site-packages\oceansdb\woa.py", line 12, in <module>
    import netCDF4

  File "C:\Users\Anaconda3-64bit\lib\site-packages\netCDF4\__init__.py", line 3, in <module>
    from ._netCDF4 import *

  File "include\membuf.pyx", line 16, in init netCDF4._netCDF4

AttributeError: type object 'netCDF4._netCDF4._MemBuf' has no attribute '__reduce_cython__'

I have tried uninstalling and reinstalling netCDF4, then upgrading my cython version and doing the same uninstall/reinstall, both to no avail. I also tried uninstalling and reinstalling oceansdb. Everything has yielded the same error and I can't seem to find anyone else with the same issue.

  • Does this answer your question? [AttributeError: type object 'pandana.cyaccess.cyaccess' has no attribute '\_\_reduce\_cython\_\_'](https://stackoverflow.com/questions/58275685/attributeerror-type-object-pandana-cyaccess-cyaccess-has-no-attribute-redu) – ead Apr 19 '20 at 10:01

1 Answers1

0

I was getting a similar error. I think the key is the versions of the packages you are using.

I was using:

  • cftime 1.1.2

    cython 0.28.5

    hdf5 1.10.2

    netcdf4 1.5.3

    numpy 1.15.1

    pandas 0.23.4

    setuptools 40.2.0

and I got the error above.

With the packages below, all works great:

cftime 1.0.3.4

cython 0.28.5

hdf5 1.10.2

netcdf4 1.5.2

numpy 1.15.1

pandas 0.23.4

setuptools 40.2.0

  • Thank you. Carefully checking each package version helped to resolve a similar issue with incompatible packages – casaout Oct 14 '20 at 09:19