5

I am having troubles installing Python 3.7.3 with ssl. All my compilations are successful, but the final install of module _ssl is failed.

Step 1: install openssl

git clone https://github.com/openssl/openssl.git
cd openssl
git checkout tags/OpenSSL_1_0_2r
./Config
make
sudo make install

The openssl is installed in /usr/local/ssl

Step 2: Configure Python3.7.3

wget https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tgz
tar xzvf Python-3.7.3.tgz
cd Python-3.7.3
./configure --with-openssl=/usr/local/ssl

The configuration is correct:

checking for openssl/ssl.h in /usr/local/ssl... yes

checking whether compiling and linking against OpenSSL works... yes

checking for X509_VERIFY_PARAM_set1_host in libssl... yes

Step 3: compile python

make

Step 4a: install python

sudo make install

This step failed:

*** WARNING: renaming "_ssl" since importing it failed: build/lib.linux-x86_64-3.7/_ssl.cpython-37m-x86_64-linux-gnu.so: undefined symbol: X509_VERIFY_PARAM_set_hostflags

...

Following modules built successfully but were removed because they could not be imported:

_ssl

Step 4b: Install python into a local folder

make install prefix="~/Downloads/install"

The installation is successful in this case.

After step 4a python3 -c "import ssl" failed. But if I replace the _ssl module compiled in step 4b, the above command works.

sudo rm /usr/local/lib/python3.7/lib-dynload/_ssl.cpython-37m-x86_64-linux-gnu_failed.so
sudo cp ~/Downloads/install/lib/python3.7/lib-dynload/_ssl.cpython-37m-x86_64-linux-gnu.so /usr/local/lib/python3.7/lib-dynload/

Could anyone explain why this happens?

1

1 Answer 1

0
  1. compile openssl and make install (if by default it will be installed under "/usr/local/ssl"); make sure to compile with shared option

  2. add its full path to the linker search config file: /etc/ld.so.conf

  3. type as root: ldconfig

recompile

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.