简体   繁体   中英

Error command 'gcc' failed with exit status 1

I installed Scrapy on windows 7 64bit. When I enter scrapy startproject tutorial in CMD, I get an error:

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

To solve this, I want to install 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 :

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)

Please guide me.

The easy thing is just to install the binary builds from http://www.voidspace.org.uk/python/modules.shtml#pycrypto

Then you can attempt building the PyCrypto C extensions again at leisure:

  • Visual Studio ships with a CMD shortcut that vcvarsall.bat . Use that shortcut to start cmd.exe and run pip install from there.
  • (alternatively) Install cygwin instead of mingw to avoid having to change PyCrypto's build scripts
  • Pycrypto have dependencies on either GMP or MPIR for bignums. Cygwin ships precompiled binaries of those. I'm sure there are Mingw based projects that have GMP precompiled as well.
  • You'd need to either get prebuild binaries and headers for Pycrypto's dependencies or build them manually yourself

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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