2014-10-22 38 views
1

我試圖運行Theano與下面的代碼安裝測試:AttributeError的在Theano

import theano 
theano.test() 

不過,我會看到對應blas.py以下錯誤:

/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/theano/tensor/blas.py in default_blas_ldflags() 
    301  try: 
    302   #if numpy was linked with library that are not installed, we can't reuse them. 
--> 303   if all(not os.path.exists(dir) for dir in numpy.distutils.__config__.blas_opt_info['library_dirs']): 
    304    return "-lblas" 
    305   return ' '.join(

    AttributeError: 'module' object has no attribute '__config__' 

據我所知,AttributeError的是著名的錯誤,也有問它的問題,但我Theano在互聯網上發現的唯一的解決辦法是添加:

import numpy.distutils.config 

到blas.py.但是,這並沒有解決問題,我仍然面臨着AttributeError。

+0

是你的通過anaconda安裝numpy? – 2014-10-22 03:21:33

+0

@JamesTobin號是通過Enthought Canopy。 – 2014-10-22 03:46:10

回答

1

這是在Theano開發版本中修復的。這些2的命令

使用一個更新Theano取決於安裝是否只爲你的用戶或操作系統:

pip install --upgrade --no-deps git+git://github.com/Theano/Theano.git --user 
pip install --upgrade --no-deps git+git://github.com/Theano/Theano.git 

下面是該更新的文檔:

http://www.deeplearning.net/software/theano/install.html#bleeding-edge-install-instructions