我刚刚使用anaconda(Anaconda 2.0.1)在mac(10.9.4)上安装了PyMC,并从pymc分发页面复制了以下命令:
conda install -c https://conda.binstar.org/pymc pymc
安装过程中一切似乎都没问题(没有错误信息,所有提取都已完成)。然后当我导入它时,我收到以下错误消息:
>>> import pymc
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/anaconda/lib/python2.7/site-packages/pymc/__init__.py", line 30, in <module>
from .CommonDeterministics import *
File "/anaconda/lib/python2.7/site-packages/pymc/CommonDeterministics.py", line 21 in <module>
from .utils import safe_len, stukel_logit, stukel_invlogit, logit, invlogit, value, find_element
File "/anaconda/lib/python2.7/site-packages/pymc/utils.py", line 14, in <module>
from . import flib
ImportError: dlopen(/anaconda/lib/python2.7/site-packages/pymc/flib.so, 2): Library not loaded: /usr/local/Cellar/gfortran/4.8.2/gfortran/lib/libgfortran.3.dylib
Referenced from: /anaconda/lib/python2.7/site-packages/pymc/flib.so
Reason: image not found
我是python的新手,我真的不知道下一步该做什么不会搞砸。我键入此内容以查找其他包:
binstar search -t conda pymc
Packages:
Name | Access | Package Types | Summary
------------------------- | ------------ | --------------- | --------------------
asmeurer/pymc | public | conda | https://github.com/pymc-devs/pymc
auto/pymcu | published | conda | http://www.pymcu.com
bkreider/pymc | public | conda | https://github.com/pymc-devs/pymc
datamicroscopes/pymc | public | conda | None
fonnesbeck/pymc | public | conda | https://github.com/pymc-devs/pymc
jonsedar/pymc | public | conda | None
pymc/pymc | public | conda | None
rsignell/pymc | public | conda | Markov Chain Monte Carlo sampling toolkit.
tobeplugged/pymc | public | conda | None
tomku-test/pymc | published | conda | https://github.com/pymc-devs/pymc
所以,我应该尝试使用其中一个软件包重新安装pymc,如果是,请执行以下命令?:
conda install -c https://github.com/pymc-devs/pymc pymc
我应该删除之前安装的第一个包吗?或者新安装会覆盖(?)。或者也许很容易解决我之前发现的那些错误?
谢谢
答案 0 :(得分:2)
gfortran
现在似乎是gcc
注意:下面需要一段时间,我花了80分钟在MacBook pro上安装
brew install gcc
BTW,如果您想使用PyMC
并且不使用anaconda发行版,上述内容似乎也是必需的安装
答案 1 :(得分:1)
你缺少gfortran。如果您尚未安装brew:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
按照说明正确设置brew后,执行:
brew install gfortran
答案 2 :(得分:1)
另一种应该工作的方法(在Mac OS X上)是conda install -c asmeurer pymc
。这将从我的Binstar频道和pymc安装gcc包(包括gfortran)。