It took me some time to figure this out. I hope this page provides the info that you require. What I wanted to do was to install PyCrypto (https://www.dlitz.net/software/pycrypto/) on Windows XP. Due to law restrictions, the PyCrypto website doesn’t supply binaries. I have the Python 2.7.2 installed and MinGW as compiler. For more information about setting up Python and MinGW, see my previous post.
First I tried to use the ‘so called’ easy_install setuptools method:
Nice try, but no cigar. Apparently there’s more to it, since it fails with the following error:
error: Unable to find vcvarsall.bat
Well at least we know where the PyCrypto source package came from. 🙂
- After downloading the package, open a windows command prompt.
- Move to the directory which contains the source.
- Extract the package:
tar -zxvf pycrypto-2.5.tar.gz
- Move to the new directory:
- Build the package:
python setup.py build -c mingw32
- Install the package:
python setup.py install
- Tip: If you want to build binary installable package which you can distribute, execute the following command:
python setup.py bdist_wininst
If the building is successful, you can find the executable in the ‘dist’ directory named: ‘pycrypto-2.5.win32-py2.7‘