Error importing theano “cannot import name gof”

前端 未结 4 2125
迷失自我
迷失自我 2021-01-12 01:15

I am current getting the error

ImportError: cannot import name gof

when importing theano.

>>> import          


        
4条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-12 01:59

    This ImportError can be caused because Theano is unable to compile the gof module itself. If this is the case, you will see an error message that looks like "Exception: Compilation Failed (return status=1): C:\Long\Path\...\mod.cpp:1: sorry, unimplemented: 64-bit mode not compiled in".

    Fixing With Conda

    If you are installing theano into a conda environment, make sure that you have a C compiler available to that environment.

    The command

    conda install m2w64-toolchain
    

    will provide a C compiler to your environment that's isolated from the rest of the machine.

    After the m2w64-toolchain package is installed, import theano should work

    Fixing Manually

    If you are installing Theano yourself, two points from these threads may help:

    • Install the bleeding edge version of Theano
    • Install libpython from http://www.lfd.uci.edu/%7Egohlke/pythonlibs/

提交回复
热议问题