简体   繁体   中英

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

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?

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.

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")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM