0

So I tried to do:

pip install pycrypto --upgrade

which led me to the error:

Cannot find "vcvarsall.bat"

which led me to this solution: How to use MinGW's gcc compiler when installing Python package using Pip?

So I created a distutils.cfg and now pip uses MinGW.

But I still get an error:

error: command 'C:\\Program Files\\Cygwin\\bin\\gcc.exe' failed with exit status 1

Please help.

I have a link to the log from the install: https://dpaste.de/NhV9

I am using Windows 7 64 bit, the latest MinGW to my knowledge, and python 2.7.

Community
  • 1
  • 1
Matt M
  • 149
  • 2
  • 4
  • 17

3 Answers3

1

If you're using Python 2.7 from python.org, you could try the Microsoft Visual C++ Compiler for Python 2.7:

This package contains the compiler and set of system headers necessary for producing binary wheels for Python 2.7 packages.

alexandrul
  • 12,856
  • 13
  • 72
  • 99
  • I installed it and I still get the Unable to find vcvarsall.bat – Matt M Dec 01 '14 at 03:17
  • @MattM the easy way to use this VC compiler is to use the proper command prompt from the VC's start menu group, and then navigate to your working folder. – alexandrul Dec 01 '14 at 06:54
0

It appears that your cygwin setup does not have the gcc compiler configured correctly. I would start by looking there as it is actual compile errors not a missing compiler.

*** Here is a line from your own paste.

C:\Program Files\Python27\include/pyport.h:886:2: error: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."

error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."


This error is purely about a misconfiguration after configure ran which would point to cygwin's gcc not being configured correctly.

The compiler was found and attempted to build the source so the issue is not the vc redistributables not being found.

Community
  • 1
  • 1
0

I've successfully pip installed pycrypto with MinGW so you may just be missing the Visual C++ redistributable package[1].

That said, you can just use easy_install pycrpyto instead which will download and install the binary version.

[1] http://www.microsoft.com/en-us/download/details.aspx?id=29

randlet
  • 3,628
  • 1
  • 17
  • 21
  • Hmm...possibly because you're using 64 bit? Voidspace has 64 bit binaries[1] you might want to check out [1] http://www.voidspace.org.uk/python/modules.shtml#pycrypto – randlet Dec 01 '14 at 03:25
  • That's what I used initially but it doesn't have up to date binaries, which is why I prefer compiling updates. – Matt M Dec 01 '14 at 04:33