Trying to install pymc on Anaconda(python) in Windows 7 and getting weird error?

余生颓废 提交于 2019-12-20 04:55:07

问题


I want to run some data science algorithms using Markov Chain Monte Carlo for Bayesian analysis and am trying to install PyMC but am frustratingly getting this error...

File "C:\Anaconda\lib\site-packages\numpy\distutils\fcompiler\gnu.py", line 333, in get_libraries
raise NotImplementedError("Only MS compiler supported with gfortran on win64")
NotImplementedError: Only MS compiler supported with gfortran on win64

Why would this happen and what can I do to solve it that doesnt require me hacking up python and apparently numpy that might screw other things up at a later time?


回答1:


It turns out if I just go to the line in question ...

"C:\Anaconda\lib\site-packages\numpy\distutils\fcompiler\gnu.py"

and comment out the statement so it looks like this -

else:
    pass #raise NotImplementedError("Only MS compiler supported with gfortran on win64")

PyMC compiles just fine.




回答2:


Following on from Leon's answer, in my case it seems the problem was that my default Fortran compiler was mingw32 when gnu.py was expecting msvc. For PyMC's purposes mingw32 works fine, so if you'd prefer to weaken the conditional rather than eliminate it entirely, replace

        if c_compiler and c_compiler.compiler_type == "msvc":
            return []
        else:
            raise NotImplementedError("Only MS compiler supported with gfortran on win64")

in gnu.py with

        if c_compiler and c_compiler.compiler_type in ["msvc", "mingw32"]:
            return []
        else:
            raise NotImplementedError("Only MS compiler supported with gfortran on win64")


来源:https://stackoverflow.com/questions/25126132/trying-to-install-pymc-on-anacondapython-in-windows-7-and-getting-weird-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!