Visual C++ for Python 失败,退出状态为 2 [英] Visual C++ for Python failed with exit status 2

查看:62
本文介绍了Visual C++ for Python 失败,退出状态为 2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  File "c:\users\user\appdata\local\temp\pip_build_user\ssdeep\.eggs\cff
i-1.8.2-py2.7-win32.egg\cffi\ffiplatform.py", line 65, in _build
    raise VerificationError('%s: %s' % (e.__class__.__name__, e))

cffi.ffiplatform.VerificationError: CompileError: command 'C:\\Users\\user\\
AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin
\\cl.exe' failed with exit status 2

<小时>

清理...命令 python setup.py egg_info 在 c:\users\


Cleaning up... Command python setup.py egg_info failed with error code 1 in c:\users\

我一直收到这个错误.我在这里尝试了多种其他解决方案,但没有运气.我是不是错过了什么.谢谢

I keep getting this error. I have tried multiple other solutions on here but no luck. Am I missing something. Thanks

推荐答案

一种粗略的方法对我有用.也许有知识的人可以优化答案:

A crude method worked for me. Perhaps someone with knowledge can optimize the answer:

  1. 阅读以下文章链接
  2. 我的是 Python 2.7.我按照文章安装了Visualpython 2.7的C++编译器.安装链接
  3. 这会在您的%AppData%\Local\Programs\Common\Microsoft"中安装一个文件夹.
  4. 我复制了以下内容
    • ...\Visual C++ for Python\9.0\VC\include"到C:\Python27\include"
    • ...\Visual C++ for Python\9.0\VC\lib"到C:\Python27\libs"
    • ...\Visual C++ for Python\9.0\WinSDK\Include"到C:\Python27\include"
    • ...\Visual C++ for Python\9.0\WinSDK\lib"到C:\Python27\libs"
  • 第 #~270 行硬编码链接到vcvarsall.bat"%appdata%..\Visual C++ for Python\9.0\vcvarsall.bat"
  • 第 394 行 os.environ['include'] = "C:\\Python27\\include"
  • 第 396 行 os.environ['lib'] = "C:\\Python27\\libs"
  • 行 # ~402 硬编码了 self.cc = "...\Visual C++ for Python\9.0\VC\Bin\cl.exe" 的链接(注意:它是 \Bin而不是 \bin.)
  • 第 #~403 行类似于上面的硬编码链接到 self.linker.
  • Line # ~270 hard coded link to "vcvarsall.bat" "%appdata%..\Visual C++ for Python\9.0\vcvarsall.bat"
  • Line # ~394 os.environ['include'] = "C:\\Python27\\include"
  • Line # ~396 os.environ['lib'] = "C:\\Python27\\libs"
  • Line # ~402 hard coded the link to self.cc = "...\Visual C++ for Python\9.0\VC\Bin\cl.exe" (caution: it is \Bin and not \bin.)
  • Line # ~403 Similar to above hard coded the link to self.linker.

执行上述步骤对我有用.

Doing the above steps worked for me.

这篇关于Visual C++ for Python 失败,退出状态为 2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆