On Linux, you generally need the Python development headers to compile the package: pycrypto - PyPI

If you see an error like "Unable to find vcvarsall.bat", you may need to set an environment variable to point to your installed Visual Studio version. 3. Installing on Linux

If you must use the original PyCrypto for legacy reasons, follow these steps based on your operating system.

You must have a compatible C++ compiler installed. For older Python versions, this is often the Microsoft Visual C++ Compiler for Python 2.7.

Installing PyCrypto on Windows often fails because the package needs to be compiled from C source code.

You can download the source tar.gz from PyPI or GitHub , extract it, and run the following in your terminal: python setup.py build python setup.py install Use code with caution.