我在Windows 8上使用带有Python 3.4 64位的Anaconda
在尝试使用scikit-neuralnetwork包时,这行代码引发了以下异常:
from sknn.mlp import Classifier, Layer
我安装了GCC和g ++(4.8.1)编译器并将它们正确添加到PATH中,但是仍然出现以下错误:
WARNING (theano.configdefaults): g++ not detected ! Theano will be unable to execute optimized C-implementations (for both CPU and GPU) and will default to Python implementations. Performance will be severely degraded. To remove this warning, set Theano flags cxx to an empty string.
Problem occurred during compilation with the command line below:
g++ -shared -g -D NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -m64 -DMS_WIN64 -IC:\Users\Mi\Anaconda3\lib\site-packages\numpy\core\include - IC:\Users\Mi\Anaconda3\include -o C:\Users\Mi\AppData\Local\Theano\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_61_Stepping_4_GenuineIntel-3.4.3-64\lazylinker_ext\lazylinker_ext.pyd C:\Users\Mi\AppData\Local\Theano\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_61_Stepping_4_GenuineIntel-3.4.3-64\lazylinker_ext\mod.cpp -LC:\Users\Mi\Anaconda3\libs -LC:\Users\Mi\Anaconda3 -lpython34
Traceback (most recent call last):
File "C:\Users\Mi\Anaconda3\lib\site-packages\theano\gof\lazylinker_c.py", line 65, in <module>
raise ImportError()
ImportError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Mi\Anaconda3\lib\site-packages\theano\gof\lazylinker_c.py", line 82, in <module>
raise ImportError()
ImportError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Mi\Desktop\temp22.py", line 10, in <module>
from sknn.mlp import Classifier, Layer
File "C:\Users\Mi\Anaconda3\lib\site-packages\sknn\mlp.py", line 17, in <module>
import theano
File "C:\Users\Mi\Anaconda3\lib\site-packages\theano\__init__.py", line 55, in <module>
from theano.compile import \
File "C:\Users\Mi\Anaconda3\lib\site-packages\theano\compile\__init__.py", line 9, in <module>
from theano.compile.function_module import *
File "C:\Users\Mi\Anaconda3\lib\site-packages\theano\compile\function_module.py", line 18, in <module>
import theano.compile.mode
File "C:\Users\Mi\Anaconda3\lib\site-packages\theano\compile\mode.py", line 11, in <module>
import theano.gof.vm
File "C:\Users\Mi\Anaconda3\lib\site-packages\theano\gof\vm.py", line 568, in <module>
from . import lazylinker_c
File "C:\Users\Mi\Anaconda3\lib\site-packages\theano\gof\lazylinker_c.py", line 117, in <module>
preargs=args)
File "C:\Users\Mi\Anaconda3\lib\site-packages\theano\gof\cmodule.py", line 1989, in compile_str
compile_stderr = decode(p_out[1])
File "C:\Users\Mi\Anaconda3\lib\site-packages\theano\compat\__init__.py", line 35, in decode
return x.decode()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe8 in position 10: invalid continuation byte
答案 0 :(得分:0)
此错误通常通过运行以下内容来解决,如documentation中所述。
conda install mingw libpython
由于您现在已经安装了自己的GCC安装,因此您可能需要使用环境变量,尤其是PATH
以使其工作正常。