2 years ago
#69692

William Song
Got AttributeError when importing theano
I got following error when importing theano by import theano
in Python3.8. How do I fix it?
Last line is:
AttributeError: module 'numpy.distutils.__config__' has no attribute 'blas_opt_info'
[~] python -c "import theano"
19:45:49 Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/theano/configparser.py", line 168, in fetch_val_for_key return theano_cfg.get(section, option) File "/usr/local/Cellar/python@3.8/3.8.12_1/Frameworks/Python.framework/Versions/3.8/lib/python3.8/configparser.py", line 781, in get d = self._unify_values(section, vars) File "/usr/local/Cellar/python@3.8/3.8.12_1/Frameworks/Python.framework/Versions/3.8/lib/python3.8/configparser.py", line 1149, in _unify_values raise NoSectionError(section) from None configparser.NoSectionError: No section: 'blas'During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/theano/configparser.py", line 327, in get val_str = fetch_val_for_key(self.fullname, File "/usr/local/lib/python3.8/site-packages/theano/configparser.py", line 172, in fetch_val_for_key raise KeyError(key) KeyError: 'blas.ldflags'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.8/site-packages/theano/init.py", line 124, in from theano.scan_module import (scan, map, reduce, foldl, foldr, clone, File "/usr/local/lib/python3.8/site-packages/theano/scan_module/init.py", line 41, in from theano.scan_module import scan_opt File "/usr/local/lib/python3.8/site-packages/theano/scan_module/scan_opt.py", line 60, in from theano import tensor, scalar File "/usr/local/lib/python3.8/site-packages/theano/tensor/init.py", line 17, in from theano.tensor import blas File "/usr/local/lib/python3.8/site-packages/theano/tensor/blas.py", line 155, in from theano.tensor.blas_headers import blas_header_text File "/usr/local/lib/python3.8/site-packages/theano/tensor/blas_headers.py", line 987, in if not config.blas.ldflags: File "/usr/local/lib/python3.8/site-packages/theano/configparser.py", line 332, in get val_str = self.default() File "/usr/local/lib/python3.8/site-packages/theano/configdefaults.py", line 1284, in default_blas_ldflags blas_info = np.distutils.config.blas_opt_info AttributeError: module 'numpy.distutils.config' has no attribute 'blas_opt_info'
PS: python3.8 macOS10.15
PSS: It is required by pymc3
python-3.x
theano
0 Answers
Your Answer