swig unable to find openssl conf

2020-02-29 10:52发布

问题:

Trying to install m2crypto and getting these errors, can anyone help ?

SWIG/_evp.i:12: Error: Unable to find 'openssl/opensslconf.h'
SWIG/_ec.i:7: Error: Unable to find 'openssl/opensslconf.h'

回答1:

ln -s /usr/include/x86_64-linux-gnu/openssl/opensslconf.h /usr/include/openssl/opensslconf.h

Just made this and everything worked fine.



回答2:

Installing libssl-dev (which contains development libraries, header files) will solve the issue.

sudo apt-get install libssl-dev


回答3:

This was a bug in M2Crypto, fixed in at least 0.25.1. The particular commit is ecc678d52e6525f9e3278a7cedfa110a64244937.



回答4:

On CentOS or RHEL, run the following to install OpenSSL development libraries and headers:

# yum install openssl-devel 


回答5:

@gordon33 reply is good, but if you don't have root (e.g. Travis-CI), you can also add option to pip install that will tell it to pass the options to build environment and compiler options:

pip install --global-option=build_ext --global-option="-I/usr/include/x86_64-linux-gnu" m2crypto