笔记-ubuntu14.04安装pymc

PyMC是一个实现贝叶斯统计模型和马尔科夫链蒙塔卡洛采样工具拟合算法的Python库。

sudo easy_install pymc

报错,说找不到numpy,但明明numpy已经安装了啊。找了方案,要使用pip3 install numpy才行,于是用pip3重装了numpy

再次sudo easy_install pymc, 却又报错:

Could not locate executable gfortran

Could not locate executable f95

Could not locate executable ifort

Could not locate executable ifc

Could not locate executable lf95

Could not locate executable pgfortran

Could not locate executable f90

Could not locate executable f77

Could not locate executable fort

Could not locate executable efort

Could not locate executable efc

Could not locate executable g77

Could not locate executable g95

Could not locate executable pathf95

Could not locate executable nagfor

don’t know how to compile Fortran code on platform ‘posix’

说是需要安装gfortran,于是,sudo apt-get install gfortran

再次sudo easy_install pymc, 却又报错:

pyconfig.h文件找不到。找了方案,说是必须sudo apt-get install python-dev python3-dev,于是这么做了。

再次sudo easy_install pymc,才终于安装完成!

用import pymc测试

发现,python2.7仍然不认识pymc,python3.4认识却在scipy处崩溃。有方案说,需要sudo easy_install pymc3,于是这么做了。

用import pymc测试

这下,python3.4可以执行了,python2.7仍然不认识pymc。没办法,只好放弃,以后看有机会在搞定2.7。

用pymc.test()测试

挂了。在nose_tools.utils.py的71行。于是用sudo easy_install nose,把nose重装一遍。

用pymc.test()测试

这次,很快跑了177个测试,1个error。

    原文作者:Z-HE
    原文地址: https://zhuanlan.zhihu.com/p/36111047
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞