"error: Unable to find vcvarsall.bat" when installing Fabric (Python library) on Windows

fabric, python, windows

Solution

I believe the root cause is as described here:

Some Windows users whose Python is 64-bit have found that the PyCrypto dependency winrandom may not install properly, leading to ImportErrors. In this scenario, you’ll probably need to compile winrandom yourself via e.g. MS Visual Studio. See #194 for info.

I've been able to resolve the issue by downloading and installing a PyCrypto binary from Michael Foord's website and then re-installing Fabric. Many thanks Michael!

Problem

I tried installing Fabric in my Windows 7 64-bit machine and all I got was this lousy error message: building 'Crypto.Random.OSRNG.winrandom' extension warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath. error: Unable to find vcvarsall.bat None of the answers in this similar question error: Unable to find vcvarsall.bat worked for me. What to do?

Original source

Related problems