MichalDanielDobrzanski / DeepLearningPython

neuralnetworksanddeeplearning.com integrated scripts for Python 3.5.2 and Theano with CUDA support
MIT License
2.79k stars 1.27k forks source link

Resolving "AttributeError: module 'numpy.core.multiarray' has no attribute '_get_ndarray_c_version'" on Python 3.7.2 using numpy 1.1.6 #20

Closed sheikheddy closed 3 years ago

sheikheddy commented 5 years ago

Go to (wherever you have the package installed)/theano/gof/cc.py

Remove this section here (around line 1376):

# We must always add the numpy ABI version here as 
          # DynamicModule always add the include <numpy/arrayobject.h> 
        if np.lib.NumpyVersion(np.__version__)<'1.16.0a': 
            ndarray_c_version = np.core.multiarray._get_ndarray_c_version() 
        else: 
            ndarray_c_version = 
np.core._multiarray_umath._get_ndarray_c_version() 
          sig.append('NPY_ABI_VERSION=0x%X' % 
                   ndarray_c_version) 
                   np.core.multiarray._get_ndarray_c_version()) 

up to but not including this part:

  if c_compiler: 
          sig.append('c_compiler_str=' + c_compiler.version_str()) 
MichalDanielDobrzanski commented 3 years ago

I would not be modifying the external dependency. I am closing this issue.