anaconda/spyder安装pymc3.8后WARNING (theano.configdefaults): g++ not available解决办法

在官网上下载pymc3.8的镜像文件后用pip install命令进行安装,安装后调用pymc3出现如下警告:

>>> import pymc3
WARNING (theano.configdefaults): g++ not available, if using conda: `conda install m2w64-toolchain`

Warning (from warnings module):
  File "D:\anaconda3\lib\site-packages\theano\configdefaults.py", line 560
    warnings.warn("DeprecationWarning: there is no c++ compiler."
UserWarning: DeprecationWarning: there is no c++ compiler.This is deprecated and with Theano 0.11 a c++ compiler will be mandatory
WARNING (theano.configdefaults): g++ not detected ! Theano will be unable to execute optimized C-implementations (for both CPU and GPU) and will default to Python implementations. Performance will be severely degraded. To remove this warning, set Theano flags cxx to an empty string.
WARNING (theano.tensor.blas): Using NumPy C-API based implementation for BLAS functions.

原因在于电脑缺少c++编译环境
很明显,我们需要在cmd中通过命令conda install m2w64-toolchain进行相关的编译程序的安装(大概100多M)

也可以不安装c++编译环境,可以把Theano的标志cxx设置为空,来消除以上警告

虽然安装时间有点长,但安装c++环境相关程序后,它们会把pymc3重新根据你的CPU、GPU编译优化一遍,这个好处还是挺大的(相对来说机器学习也比较吃硬件叭)

你可能感兴趣的:(anaconda/spyder安装pymc3.8后WARNING (theano.configdefaults): g++ not available解决办法)