深度學習Theano庫在Anaconda下的安裝(window版)
第一步:安裝Anaconda2。在網站https://www.continuum.io/downloads上下載32位的版本,選擇安裝路徑進行安裝;
第二步:打開windows命令行界面,輸入conda install mingw libpython後運行,這是在安裝mingw的g++和libpython。因爲theano是拿cpython編寫,後續需要g++進行編譯。這個過程有些長,安裝完後,可以在Anaconda2的文件夾中出現MinGW的文件夾。
第三步:使用pip安裝theano。在windows的命令行界面輸入pip install theano,點解運行,隨後在Anaconda2--Libs--site-packages中出現theano文件夾。
第四步:配置環境變量。在Administrator的用戶變量中,編輯path,在後面添加C:\Users\Administrator\Anaconda2\MinGW\bin;C:\Users\Administrator\Anaconda2\MinGW\i686-w64-mingw32\lib;(我的Anaconda2安裝在C:\Users\Administrator下)。
第五步:進入cmd,用“fsutil file createnew .theanorc.txt 0” 創建文本。添加文本內容:
[blas]
ldflags=
[gcc]
cxxflags = -IC:\Users\Administrator\Anaconda2\MinGW\i686-w64-mingw32\include
點擊保存。
第六步:在window命令行中輸入python,然後輸入import theano即可。若不出錯,即安裝成功。如下界面即可。