我正在尝试安装pylearn2软件包(http://deeplearning.net/software/pylearn2/)。我使用WinPython-64bit-3.4.4.1在Windows 7(x64)中执行此操作。首先有一个错误说:" Microsoft Visual C ++ 10.0是必需的(无法找到vcvarsall.bat)"。然后我安装VS2012并配置环境变量。执行" python setup.py develop"后,出现了一个新的错误,引用如下:
E:\WinPython-64bit-3.4.4.1\download\pylearn2>python setup.py develop
WARNING (theano.configdefaults): g++ not detected ! Theano will be unable to exe
cute optimized C-implementations (for both CPU and GPU) and will default to Pyth
on implementations. Performance will be severely degraded. To remove this warning, set Theano flags cxx to an empty string.E:\WinPython-64bit3.4.4.1\python-3.4.4.amd64\lib\site-packages\setuptools\dist.
py:285: UserWarning: Normalizing '0.1dev' to '0.1.dev0'normalized_version,
running develop
running egg_info
creating pylearn2.egg-info
writing top-level names to pylearn2.egg-info\top_level.txt
writing requirements to pylearn2.egg-info\requires.txt
writing pylearn2.egg-info\PKG-INFO
writing dependency_links to pylearn2.egg-info\dependency_links.txt
writing manifest file 'pylearn2.egg-info\SOURCES.txt'
reading manifest file 'pylearn2.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'pylearn2.egg-info\SOURCES.txt'
running build_ext
cythoning pylearn2/utils/_window_flip.pyx to pylearn2/utils\_window_flip.c
building 'pylearn2.utils._window_flip' extension
creating build
creating build\temp.win-amd64-3.4
creating build\temp.win-amd64-3.4\Release
creating build\temp.win-amd64-3.4\Release\pylearn2
creating build\temp.win-amd64-3.4\Release\pylearn2\utils
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IE:\WinPython-64bit-3.4.4.1\python-3.4.4.amd64\lib\site-packages\numpy\core\include -IE:\WinPython-64bit-3.4.4.1\python-3.4.4.amd64\include -IE:\WinPython-64bit-3.4.4.1\python-3.4.4.amd64\include /Tcpylearn2/utils\_window_flip.c /Fobuild\temp.win-amd64-3.4\Release\pylearn2/utils\_window_flip.obj
Found executable C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\amd64\cl.exe
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\amd64\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:E:\WinPython-64bit-3.4.4.1\python3.4.4.amd64\libs /LIBPATH:E:\WinPython-64bit-3.4.4.1\python3.4.4.amd64\PCbuild\amd64
/EXPORT:PyInit__window_flip build\temp.win-amd643.4\Release\pylearn2/utils\_window_flip.obj /OUT:E:\WinPython-64bit-3.4.4.1\download\pylearn2\pylearn2\utils\_window_flip.pyd
/IMPLIB:build\temp.win-amd64-3.4\Release\pylearn2/utils\_window_flip.lib
/MANIFESTFILE:build\temp.win-amd643.4\Release\pylearn2/utils\_window_flip.pyd.manifest
Found executable C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\amd64\link.exe
_window_flip.obj : warning LNK4197: export 'PyInit__window_flip' specified multiple times; using first specification
Creating library build\temp.win-amd643.4\Release\pylearn2/utils\_window_flip
.lib and object build\temp.win-amd64-3.4\Release\pylearn2/utils\_window_flip.exp
_window_flip.obj : error LNK2019: unresolved external symbol rand_r referenced in function__pyx_pf_8pylearn2_5utils_12_window_flip_2random_window_and_flip_c01b
**E:\WinPython-64bit-3.4.4.1\download\pylearn2\pylearn2\utils\_window_flip.pyd : fatal error LNK1120: 1 unresolved externals
error: Command "C:\Program Files (x86)\Microsoft Visual Studio12.0\VC\BIN\amd64\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:E:\WinPython-64bit-3.4.4.1\python-3.4.4.amd64\libs /LIBPATH:E:\WinPython-64bit-3.4.4.1\python-3.4.4.amd64\PCbuil
d\amd64 /EXPORT:PyInit__window_flip build\temp.win-amd64-3.4\Release\pylearn2/utils\_window_flip.obj /OUT:E:\WinPython-64bit-3.4.4.1\download\pylearn2\pylearn2\
utils\_window_flip.pyd /IMPLIB:build\temp.win-amd64-3.4\Release\pylearn2/utils\_
window_flip.lib /MANIFESTFILE:build\temp.win-amd64-3.4\Release\pylearn2/utils\_w
indow_flip.pyd.manifest"** **failed with exit status 1120**
答案 0 :(得分:0)
我得到了同样的错误。它是github上的open issue。他们推荐的解决方案对我有用。它涉及编辑此文件:
pylearn2-master/pylearn2/utils/_window_flip.pyx
并更改第13行:
IF UNAME_SYSNAME == "Windows":
为:
IF UNAME_SYSNAME == u"Windows":
然后重试安装。
CB4
答案 1 :(得分:0)
我遇到了同样的问题,实际上面对一个新问题,如果你想看看它,这里是:Github Issue 1572。
我找到了一个简单的解决方法。
步骤如下:
你就是,你很高兴。 :)
尝试:import pylearn2
并查看它是否有效。
干杯。