2015-05-21 37 views
1

這本使用from sknn.mlp import *錯誤再次出現在Enthought CanopyTheano包的Python(冠)的返回錯誤:無法導入名稱GOF

ImportError        Traceback (most recent call last) 
C:\Users\User_Account\Desktop\axxx.py in <module>() 
----> 1 from sknn.mlp import * 

C:\Users\User_Account\AppData\Local\Enthought\Canopy\User\lib\site-packages\sknn\mlp.py in <module>() 
    13 
    14 import numpy 
---> 15 import theano 
    16 import sklearn.base 
    17 import sklearn.pipeline 

C:\Users\User_Account\AppData\Local\Enthought\Canopy\User\lib\site-packages\theano\__init__.py in <module>() 
    53  object2, utils) 
    54 
---> 55 from theano.compile import (
    56  SymbolicInput, In, 
    57  SymbolicOutput, Out, 

C:\Users\User_Account\AppData\Local\Enthought\Canopy\User\lib\site-packages\theano\compile\__init__.py in <module>() 
     7   SpecifyShape, specify_shape, register_specify_shape_c_code) 
     8 
----> 9 from theano.compile.function_module import * 
    10 
    11 from theano.compile.mode import * 

C:\Users\User_Account\AppData\Local\Enthought\Canopy\User\lib\site-packages\theano\compile\function_module.py in <module>() 
    15 
    16 import theano 
---> 17 from theano import gof 
    18 from theano.compat import partial 
    19 import theano.compile.mode 

ImportError: cannot import name gof 

In [3]: %run "C:/Users/Rahimikia/Desktop/axxx.py" 
--------------------------------------------------------------------------- 
ImportError        Traceback (most recent call last) 
C:\Users\User_Account\Desktop\axxx.py in <module>() 
----> 1 import theano 

C:\Users\User_Account\AppData\Local\Enthought\Canopy\User\lib\site-packages\theano\__init__.py in <module>() 
    53  object2, utils) 
    54 
---> 55 from theano.compile import (
    56  SymbolicInput, In, 
    57  SymbolicOutput, Out, 

C:\Users\User_Account\AppData\Local\Enthought\Canopy\User\lib\site-packages\theano\compile\__init__.py in <module>() 
     7   SpecifyShape, specify_shape, register_specify_shape_c_code) 
     8 
----> 9 from theano.compile.function_module import * 
    10 
    11 from theano.compile.mode import * 

C:\Users\User_Account\AppData\Local\Enthought\Canopy\User\lib\site-packages\theano\compile\function_module.py in <module>() 
    15 
    16 import theano 
---> 17 from theano import gof 
    18 from theano.compat import partial 
    19 import theano.compile.mode 

ImportError: cannot import name gof 

In [4]: %run "C:/Users/Rahimikia/Desktop/axxx.py" 
--------------------------------------------------------------------------- 
ImportError        Traceback (most recent call last) 
C:\Users\User_Account\Desktop\axxx.py in <module>() 
----> 1 import theano 

C:\Users\User_Account\AppData\Local\Enthought\Canopy\User\lib\site-packages\theano\__init__.py in <module>() 
    53  object2, utils) 
    54 
---> 55 from theano.compile import (
    56  SymbolicInput, In, 
    57  SymbolicOutput, Out, 

C:\Users\User_Account\AppData\Local\Enthought\Canopy\User\lib\site-packages\theano\compile\__init__.py in <module>() 
     7   SpecifyShape, specify_shape, register_specify_shape_c_code) 
     8 
----> 9 from theano.compile.function_module import * 
    10 
    11 from theano.compile.mode import * 

C:\Users\User_Account\AppData\Local\Enthought\Canopy\User\lib\site-packages\theano\compile\function_module.py in <module>() 
    15 
    16 import theano 
---> 17 from theano import gof 
    18 from theano.compat import partial 
    19 import theano.compile.mode 

ImportError: cannot import name gof 

In [5]: %run "C:/Users/Rahimikia/Desktop/axxx.py" 
--------------------------------------------------------------------------- 
ImportError        Traceback (most recent call last) 
C:\Users\User_Account\Desktop\axxx.py in <module>() 
----> 1 import theano 

C:\Users\User_Account\AppData\Local\Enthought\Canopy\User\lib\site-packages\theano\__init__.py in <module>() 
    53  object2, utils) 
    54 
---> 55 from theano.compile import (
    56  SymbolicInput, In, 
    57  SymbolicOutput, Out, 

C:\Users\User_Account\AppData\Local\Enthought\Canopy\User\lib\site-packages\theano\compile\__init__.py in <module>() 
     7   SpecifyShape, specify_shape, register_specify_shape_c_code) 
     8 
----> 9 from theano.compile.function_module import * 
    10 
    11 from theano.compile.mode import * 

C:\Users\User_Account\AppData\Local\Enthought\Canopy\User\lib\site-packages\theano\compile\function_module.py in <module>() 
    15 
    16 import theano 
---> 17 from theano import gof 
    18 from theano.compat import partial 
    19 import theano.compile.mode 

ImportError: cannot import name gof 

我怎樣才能解決這個問題?我在Windows 8.1中使用軟件包管理器安裝了mingwlibpython,並安裝了Theano開發人員版本,使用pip install --upgrade --no-deps git+git://github.com/Theano/Theano.git

+0

哪個Python版本? – tamasgal

+0

Canopy默認的python版本。我認爲它是'2.7.6'。 – user2991243

+0

如果你'想',我們只能推測。 – tamasgal

回答

-1

你可以閱讀這個bug在這裏的歷史:

https://github.com/Theano/Theano/issues/2406

它說

The problem appears to be that the compilation is trying to link with the static library libpython2.7.a, instead of the dynamic version of the library (which should be something like libpython2.7.so).

後來

Hey,thanks for your reply, I did remake python and do altinstall ,solved this problem.

您應該重建的Python,這將是精細。

UPDATE

我想你應該擺脫冠層和手動安裝Python。 Canopy似乎是一個現成的Python和一些科學軟件包的發行版本,我猜Theano在這個時候不會工作。

谷歌,以瞭解如何在Windows上安裝的Python(我從來沒有使用過Windows系統),例如這個:http://www.anthonydebarros.com/2014/02/16/setting-up-python-in-windows-8-1/

,然後通過pip安裝所有需要的軟件包。

+0

謝謝你的回答。我如何重建(重拍)Python? – user2991243

+0

我更新了我的答案。 – tamasgal

+0

正如此處討論的:Canopy支持安裝Theano:http://deeplearning.net/software/theano/install_windows.html – user2991243

相關問題