繁体   English   中英

错误命令'gcc'失败,退出状态为1

[英]Error command 'gcc' failed with exit status 1

我在Windows 7 64bit上安装了Scrapy。 当我在CMD中输入scrapy startproject tutorial时,出现错误:

ImportError: No module named `cryptography.hazmat.bindings.openssl.binding`

为了解决这个问题,我想安装pycrypto。 当我运行pip install pycrypto ,下一个错误是: _Unable to find vcvarsall.bat _ ,因为我已经安装了Visual Studio 2010,为解决此问题,我安装了mingw32并设置了环境变量并禁用了防病毒功能,并从中删除了-mno-cygwin cygwinccompiler.py

if self.gcc_version < '4' or is_cygwingcc():
    no_cygwin = ''
else:
    no_cygwin = ' -mno-cygwin'

变成了:

if self.gcc_version < '4' or is_cygwingcc():
    no_cygwin = ''
else:
    no_cygwin = ''

现在我得到了错误:

error command 'gcc' failed with exit status 1

(安装了python 2.7 64)

请指导我。

简单的事情就是从http://www.voidspace.org.uk/python/modules.shtml#pycrypto安装二进制版本

然后,您可以尝试再次随意构建PyCrypto C扩展:

  • Visual Studio附带了一个vcvarsall.bat的CMD快捷方式。 使用该快捷方式启动cmd.exe并从此处运行pip install
  • (或者)安装cygwin而不是mingw,以避免必须更改PyCrypto的构建脚本
  • Pycrypto依赖于GMP或 MPIR。 Cygwin会提供这些文件的预编译二进制文件。 我敢肯定,还有基于Mingw的项目也已经预编译了GMP。
  • 您需要获取Pycrypto依赖项的预构建二进制文件和标头,或者自己手动构建它们

暂无
暂无

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

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