python - Pip 安装失败,faSTLz 模块上出现退出代码 2/错误代码 1

标签 python c++ pip

从 pip 安装“faSTLz”时,我遇到了一个我似乎无法破译的 Visual C++ 错误。 pip 正在运行模块的 setup.py 并遇到编译器错误“退出状态 2”,然后报告它遇到“错误代码 1”。

这是 pip 安装的输出:

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 会出现相同的错误。

最佳答案

有同样的问题(与 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++ 开发。等待安装完成,重启。

关于python - Pip 安装失败,faSTLz 模块上出现退出代码 2/错误代码 1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40045838/

相关文章:

Python:将列表列表插入另一个列表列表

c++ - std::partition 快速排序实现

python - 将 Pip 和 Yolk 放置在虚拟环境内部还是外部?

c++ - OpenGL故障;抗锯齿 MSAA 8x 后白线中的黑色像素

python word2vec 没有安装

python - "No Module named ' _portaudio' : Unable to find solution

python - 检查字符串的任何(所有)字符是否在给定范围内

python - 使用 wxPython 显示 Mac OS X 滑动对话框

Python range() 和 zip() 对象类型

c++ - 如何动态更新 ncurses 中的菜单项?