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

时间:2014-03-17 12:54:59

标签: python python-2.7 gcc

我在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)

请指导我。

1 个答案:

答案 0 :(得分:0)

简单的方法就是从http://www.voidspace.org.uk/python/modules.shtml#pycrypto

安装二进制版本

然后你可以在闲暇时再次尝试构建PyCrypto C扩展:

  • Visual Studio附带了vcvarsall.bat的CMD快捷方式。使用该快捷方式启动cmd.exe并从那里运行pip install
  • (或者)安装cygwin而不是mingw以避免更改PyCrypto的构建脚本
  • Pycrypto对bignums有依赖either GMP or MPIR。 Cygwin发布了那些预编译的二进制文件。我确信有基于Mingw的项目也预先编译了GMP。
  • 您需要为Pycrypto的依赖项获取预构建二进制文件和标头,或者自己手动构建它们