pip install m2crypto
Generates the following output:
building 'M2Crypto.__m2crypto' extension
swigging SWIG/_m2crypto.i to SWIG/_m2crypto_wrap.c
swig -python -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/usr/include -I/usr/include/openssl -includeall -modern -o SWIG/_m2crypto_wrap.c SWIG/_m2crypto.i
SWIG/_m2crypto.i:30: Error: Unable to find 'openssl/opensslv.h'
SWIG/_m2crypto.i:33: 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: command 'swig' failed with exit status 1
I've run:
brew install swig
Got exact same issue on Ubuntu 18.04 LTS, while trying to execute
Did the following to get rid of it:
I just went through a lot of pain getting this working in El Capitan. Here is what I had to do:
Install OpenSSL (you have to use an older version, m2crypto will not compile otherwise)
Install m2crypto
AFAIK it is installed... I still have to do some testing though.
This fixed my problem (Python 2.7):
sudo apt-get install python-m2crypto
thanks to therealmarv env flags i was able to get this to work with the macports version of openssl/swig, this is what i did:
then use therealmarv lines but replace "$(brew --prefix openssl)" with the dir from macports which should be "/opt/local"
I wanted a nicer way without installing manually and using only Homebrew (which also does not link openssl by default). Also using
pip
was a requirement. This seems to work with newest m2crypto 0.22.5. I also tested it once with m2crypto 0.22.3 and seems also to work. The OpenSSL version here is 1.0.2d:Finally install m2crypto on macOS in your Bash. It is a long command but it changes SWIG and clang environment variables only during
pip install
so that m2crypto will get all OpenSSL requirements:btw. the last command also works if you use e.g. a requirements.txt.
Update:
Additional also the command for fish shell users...