简体   繁体   English

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

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

I installed Scrapy on windows 7 64bit. 我在Windows 7 64bit上安装了Scrapy。 When I enter scrapy startproject tutorial in CMD, I get an error: 当我在CMD中输入scrapy startproject tutorial时,出现错误:

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

To solve this, I want to install pycrypto. 为了解决这个问题,我想安装pycrypto。 When I run pip install pycrypto , the next error was: _Unable to find vcvarsall.bat _ , because I have installed Visual Studio 2010, to solve this, I installed mingw32 and set environment variable and disabled my antivirus and removed -mno-cygwin from cygwinccompiler.py : 当我运行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'

Became: 变成了:

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

And now I get the error: 现在我得到了错误:

error command 'gcc' failed with exit status 1

(Installed python 2.7 64) (安装了python 2.7 64)

Please guide me. 请指导我。

The easy thing is just to install the binary builds from http://www.voidspace.org.uk/python/modules.shtml#pycrypto 简单的事情就是从http://www.voidspace.org.uk/python/modules.shtml#pycrypto安装二进制版本

Then you can attempt building the PyCrypto C extensions again at leisure: 然后,您可以尝试再次随意构建PyCrypto C扩展:

  • Visual Studio ships with a CMD shortcut that vcvarsall.bat . Visual Studio附带了一个vcvarsall.bat的CMD快捷方式。 Use that shortcut to start cmd.exe and run pip install from there. 使用该快捷方式启动cmd.exe并从此处运行pip install
  • (alternatively) Install cygwin instead of mingw to avoid having to change PyCrypto's build scripts (或者)安装cygwin而不是mingw,以避免必须更改PyCrypto的构建脚本
  • Pycrypto have dependencies on either GMP or MPIR for bignums. Pycrypto依赖于GMP或 MPIR。 Cygwin ships precompiled binaries of those. Cygwin会提供这些文件的预编译二进制文件。 I'm sure there are Mingw based projects that have GMP precompiled as well. 我敢肯定,还有基于Mingw的项目也已经预编译了GMP。
  • You'd need to either get prebuild binaries and headers for Pycrypto's dependencies or build them manually yourself 您需要获取Pycrypto依赖项的预构建二进制文件和标头,或者自己手动构建它们

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

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