Matt M
Matt M

Reputation: 149

MinGW compiler for pip after "cannot find vcvarsall.bat" error, still does not work

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.

Upvotes: 0

Views: 1734

Answers (3)

Philip Schwartz
Philip Schwartz

Reputation: 1

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.

Upvotes: 0

randlet
randlet

Reputation: 3706

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

Upvotes: 0

alexandrul
alexandrul

Reputation: 13246

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.

Upvotes: 1

Related Questions