从pip安装'fastlz'时遇到Visual C ++错误,我似乎无法破译。 pip正在运行模块的setup.py并遇到编译器错误“退出状态2”,然后报告它遇到“错误代码1”。
以下是pip install的输出:
C:\Python27\Scripts>pip install fastlz
Collecting fastlz
Using cached fastlz-0.0.1.tar.gz
Installing collected packages: fastlz
Running setup.py install for fastlz ... error
Complete output from command c:\python27\python.exe -u -c "import setuptools
, tokenize;__file__='c:\\users\\user1\\appdata\\local\\temp\\pip-build-bnrzll\\
fastlz\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().
replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\user1\appd
ata\local\temp\pip-olbxjw-record\install-record.txt --single-version-externally-
managed --compile:
running install
running build
running build_ext
building 'fastlz' extension
creating build
creating build\temp.win32-2.7
creating build\temp.win32-2.7\Release
creating build\temp.win32-2.7\Release\fastlz
C:\Users\user1\AppData\Local\Programs\Common\Microsoft\Visual C++ for Pytho
n\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ifastlz -Ic:\python27\
include -Ic:\python27\PC /Tcfastlz.c /Fobuild\temp.win32-2.7\Release\fastlz.obj
fastlz.c
fastlz.c(33) : error C2065: 'uint32_t' : undeclared identifier
fastlz.c(33) : error C2065: 'uint32_t' : undeclared identifier
fastlz.c(33) : error C2064: term does not evaluate to a function taking 302
arguments
fastlz.c(37) : error C2065: 'uint32_t' : undeclared identifier
fastlz.c(40) : error C2065: 'uint32_t' : undeclared identifier
fastlz.c(50) : error C2065: 'uint32_t' : undeclared identifier
fastlz.c(64) : error C2065: 'uint32_t' : undeclared identifier
fastlz.c(64) : error C2146: syntax error : missing ';' before identifier 'ou
tput_len'
fastlz.c(64) : error C2065: 'output_len' : undeclared identifier
fastlz.c(64) : error C2065: 'decompressed_len' : undeclared identifier
fastlz.c(69) : error C2065: 'uint32_t' : undeclared identifier
fastlz.c(69) : error C2146: syntax error : missing ')' before identifier 'in
put_len'
fastlz.c(69) : error C2065: 'uint32_t' : undeclared identifier
fastlz.c(69) : error C2059: syntax error : ')'
fastlz.c(69) : error C2143: syntax error : missing ';' before '{'
fastlz.c(69) : warning C4552: '<' : operator has no effect; expected operato
r with side-effect
fastlz.c(74) : error C2065: 'output_len' : undeclared identifier
fastlz.c(74) : error C2065: 'uint32_t' : undeclared identifier
fastlz.c(76) : error C2065: 'output_len' : undeclared identifier
fastlz.c(81) : error C2065: 'output_len' : undeclared identifier
fastlz.c(85) : error C2065: 'uint32_t' : undeclared identifier
fastlz.c(86) : error C2065: 'uint32_t' : undeclared identifier
fastlz.c(88) : error C2065: 'decompressed_len' : undeclared identifier
fastlz.c(88) : error C2065: 'uint32_t' : undeclared identifier
fastlz.c(88) : error C2146: syntax error : missing ';' before identifier 'fa
stlz_decompress'
fastlz.c(89) : error C2065: 'output_len' : undeclared identifier
fastlz.c(91) : error C2065: 'decompressed_len' : undeclared identifier
fastlz.c(91) : error C2065: 'output_len' : undeclared identifier
fastlz.c(100) : error C2065: 'output_len' : undeclared identifier
error: command 'C:\\Users\\user1\\AppData\\Local\\Programs\\Common\\Microso
ft\\Visual C++ for Python\\9.0\\VC\\Bin\\cl.exe' failed with exit status 2
----------------------------------------
Command "c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\
\users\\user1\\appdata\\local\\temp\\pip-build-bnrzll\\fastlz\\setup.py';exec(c
ompile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), _
_file__, 'exec'))" install --record c:\users\user1\appdata\local\temp\pip-olbxj
w-record\install-record.txt --single-version-externally-managed --compile" faile
d with error code 1 in c:\users\user1\appdata\local\temp\pip-build-bnrzll\fastl
z\
我似乎无法找出这些错误代码的含义。有没有人经历过这个,并知道我可以做些什么来解决这些错误 代码?运行setup.py会形成相同的错误。
答案 0 :(得分:0)
有相同的问题(与Visual Studio有关):
error: command 'C:\\Users\\user1\\AppData\\Local\\Programs\\Common\\Microso
ft\\Visual C++ for Python\\9.0\\VC\\Bin\\cl.exe' failed with exit status 2
从控制面板-启动“添加删除软件”,然后选择在Visual Studio上进行修改-添加C ++开发。等待安装完成,然后重新启动。