[pycrypto] Building a Win32 egg for PyCrypto 2.5

George V. Reilly george at reilly.org
Sat Apr 19 22:22:39 PDT 2014


Today I needed to install PyCrypto into a virtualenv on a Windows box
that didn't have a compiler. I found that using easy_install against
the installer executable worked well.

  REM download a PyCrypto installer from
http://www.voidspace.org.uk/python/modules.shtml#pycrypto
  REM say, pycrypto-2.6.win32-py2.7.exe

  MyEnv\Scripts\activate.bat
  easy_install pycrypto-2.6.win32-py2.7.exe

More than two years later, there's still zero Windows-related
information on building or installing PyCrypto anywhere on the
website. Since it's non-trivial, this omission continues to disappoint
me.
-- 
/George V. Reilly  george at reilly.org  Twitter: @georgevreilly
http://www.georgevreilly.com/blog


On Sun, Jan 29, 2012 at 11:18 PM, George V. Reilly <george at reilly.org> wrote:
>
> I'm really surprised that there's no information on building Win32 eggs anywhere on the PyCrypto website or in the PyCrypto docs. With all the export regulations, I can understand why you might not want to supply pre-built binaries, but it would be good to explain how to do it. Michael Foord has supplied such binaries for earlier versions of PyCrypto, but there's none available for PyCrypto 2.5 yet.
>
> I managed to figure it out today, with an assist from https://tahoe-lafs.org/trac/tahoe-lafs/wiki/HowtoBuildPyCryptoOnWindows
>
> Here's the batch file that I used:
>
>
> REM Build a Win32 egg for Python 2.6 or 2.7
> REM Assumes that you have the Visual Studio 2008 C++ compiler (Express suffices).
> REM http://www.microsoft.com/visualstudio/en-us/products/2008-editions/express
>
> if ["%VCINSTALLDIR%"]==[""] ("%VS90COMNTOOLS%"vsvars32.bat)
>
> @REM If package uses setuptools, this can be
> @REM collapsed to "python setup.py bdist_egg"
> python setup.py build
> python -c "import setuptools; execfile('setup.py')" bdist_egg
>
>
> The standard Windows binaries for Python 2.5 and earlier are built with different compilers. http://stackoverflow.com/questions/101061/building-python-c-extension-modules-for-windows gives some hints.
> --
> /George V. Reilly  george at reilly.org  Twitter: @georgevreilly
> http://www.georgevreilly.com/blog  http://blogs.cozi.com/tech


More information about the pycrypto mailing list