easy_install M2Crypto failing on Windows platform
Asked Answered
F

2

4

I am attempting to install M2Crypto on a Windows XP platform. I have Python, easy_install and SWIG installed, but when I attempt to easy_install M2Crypto I get the following:

SWIG\_m2crypto.i(31) : Error: Unable to find 'openssl\opensslv.h'
SWIG\_m2crypto.i(45) : Error: Unable to find 'openssl\safestack.h'
SWIG\_evp.i(12) : Error: Unable to find 'openssl\opensslconf.h'
SWIG\_ec.i(7) : Error: Unable to find 'openssl\opensslconf.h'
error: Setup script exited with error: command 'swig.exe' failed with exit status 1

I have read elsewhere that people have suggested easy_install openssl-devel, but that simply tells me that there are no packages found with that name. Is the name perhaps case-sensitive (I've tried various permutations without success), or does that advice not apply to Windows?

I'm not looking for alternatives to M2Crypto. I am picking up some existing code that uses it, so I need to get my development environment to be able to run what's already written.

Franklynfrankness answered 22/6, 2011 at 8:7 Comment(2)
I should also mention that this is Python 2.7.Franklynfrankness
You can also download and install a precompiled version of M2Crypto from here : chandlerproject.org/Projects/MeTooCryptoLynettelynn
C
4

Had a similar problem. After downloading the source package of M2Crypto and reading the INSTALL file I found the following:

Differences when installing on Windows
--------------------------------------

Before building from source, you need to install OpenSSL's include files,
import libraries and DLLs. By default setup.py assumes that OpenSSL include
files are in ``c:\pkg\openssl\include``, and the import libraries 
in ``c:\pkg\openssl\lib``. As with other platforms, you can specify a different
OpenSSL location with --openssl option to build_ext command.
Chest answered 24/6, 2011 at 7:50 Comment(1)
Thanks for the reply. I haven't had chance to check this out yet because I ended up setting up a dev environment on a non-Windows box. But I shall give it a go when I have time.Franklynfrankness
A
8

As jay stated in his answer you should try to build it from source. And I tried. The setup.py does not recognize the --openssl option. Looking at the output from the default setup.py I realized that the search location was c:\pkg and not c:\pkg\openssl. The solution:

  1. Download and install OpenSSL from Win32 OpenSSL
  2. Copy the lib and include folders to c:\pkg
  3. Check that swig.exe is available in your path
  4. Run easy_install M2Crypto

Worked for me like a charm.

Arly answered 27/9, 2012 at 9:32 Comment(0)
C
4

Had a similar problem. After downloading the source package of M2Crypto and reading the INSTALL file I found the following:

Differences when installing on Windows
--------------------------------------

Before building from source, you need to install OpenSSL's include files,
import libraries and DLLs. By default setup.py assumes that OpenSSL include
files are in ``c:\pkg\openssl\include``, and the import libraries 
in ``c:\pkg\openssl\lib``. As with other platforms, you can specify a different
OpenSSL location with --openssl option to build_ext command.
Chest answered 24/6, 2011 at 7:50 Comment(1)
Thanks for the reply. I haven't had chance to check this out yet because I ended up setting up a dev environment on a non-Windows box. But I shall give it a go when I have time.Franklynfrankness

© 2022 - 2024 — McMap. All rights reserved.