繁体   English   中英

Python 2.7.7软件包安装给出Visual C ++ cl.exe错误:命令失败,退出状态为2

[英]Python 2.7.7 package installation giving Visual C++ cl.exe error: command failed with exit status 2

安装软件包时,Python 2.7.7给出了Visual C ++问题。 我收到以下错误:

error: Setup script exited with error: command 'C:\\Program Files\\Common Files\
    \Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\cl.exe' failed with exit status
     2*
  1. 我在Windows Vista,Python 2.7.7上
  2. 我通过Windows cmd终端使用“ setup.py install”安装了软件包
  3. 我已经安装了“ Microsoft Visual C ++ Compiler for Python 2.7”,并确保路径“ C:\\ Program Files \\ Common Files \\ Microsoft \\ Visual C ++ for Python \\ 9.0 \\ VC \\ Bin \\ cl.exe”包含“ cl.exe”
  4. 根据这里的建议。 我已经检查过我的Visual C ++版本是否与我的Python版本兼容。 (我在“ C:\\ ProgramData \\ Microsoft \\ Windows \\ Start Menu \\ Programs \\ Microsoft Visual C ++ Compiler Package for Python 2.7中有一个“ Visual C ++ 2008 32位命令提示符”快捷方式。2008版是我的正确版本python版本(均为MSC v.1500。))
  5. 我已经将python setuptools更新为setuptools 17.1.1

以下是错误发生之前的安装过程记录:

Searching for python-axolotl-curve25519
Reading https://pypi.python.org/simple/python-axolotl-curve25519/
Best match: python-axolotl-curve25519 0.1
Downloading https://pypi.python.org/packages/source/p/python-axolotl-curve25519/
python-axolotl-curve25519-0.1.tar.gz#md5=f28d902df9044f0bf86a35a4bd2ec092
Processing python-axolotl-curve25519-0.1.tar.gz
Writing c:\users\eg\appdata\local\temp\easy_install-l68mxp\python-axolotl-curve2
5519-0.1\setup.cfg
Running python-axolotl-curve25519-0.1\setup.py -q bdist_egg --dist-dir c:\users\
eg\appdata\local\temp\easy_install-l68mxp\python-axolotl-curve25519-0.1\egg-dist
-tmp-hvxf2n
curve25519module.c
curve25519module.c(76) : error C2143: syntax error : missing ';' before 'type'
curve25519module.c(78) : error C2065: 'result' : undeclared identifier
curve25519module.c(82) : error C2143: syntax error : missing '{' before '*'
curve25519module.c(100) : warning C4133: 'return' : incompatible types - from 'P
yObject *' to 'int *'
curve25519module.c(146) : warning C4133: 'initializing' : incompatible types - f
rom 'int *(__cdecl *)(PyObject *,PyObject *)' to 'PyCFunction'
**error: Setup script exited with error: command 'C:\\Program Files\\Common Files\
\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\cl.exe' failed with exit status
 2**

我对此并不陌生,不知道还能尝试什么。 将不胜感激。 提前致谢。

在Windows 10上安装pycocotools时遇到此问题。Python2.7不支持编译C99代码所需的Visual C ++ 14。 这是编译错误(C2065,C4133等)的原因。

我能够解决这个问题

  1. 安装Visual Studio 2015生成工具(这将安装C ++ 14编译器)。
  2. 安装新版本的Python(建议使用3.6)

更多有关Windows编译器为Python 这里 另请检查此帖子

在此处输入图片说明

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM