报错汇总:
以pymc3=3.10版本为例:
conda创建全新虚拟环境
conda create -n pm3 python=3.8
1.numpy版本问题例如:
module 'numpy' has no attribute 'bool'.
module 'numpy.distutils.__config__' has no attribute 'blas_opt_info'
解决方法:
pip3 install --upgrade numpy==1.20.3
2.NDArray
module 'numpy.typing' has no attribute 'NDArray'
解决方法:
pip install pillow==9.0.0
3.AttributeError: module 'arviz' has no attribute 'geweke'
解决方法:
pip install arviz=0.11.0
在这步可能会出现一个报错,在一大段报错信息中找关键字:
ValueError: did not find HDF5 headers
这个问题解决方法为:
pip install netcdf4==1.5.7
到此问题暂时全部解决,可以初步运行pymc3代码
测试代码如下:
import pymc3 as pm
print(f"Running on PyMC3 v{pm.__version__}")
运行结果:
WARNING (theano.tensor.blas): Using NumPy C-API based implementation for BLAS functions.
Running on PyMC3 v3.10.0