0

I have 16.04.1-Ubuntu OS, python2.7, python3.5 and python3.11. To install python3.11 I ran the following commands:

cd python-3.11.0
./configure --enable-optimizations
sudo make install

When I try to create a new project in PyCharm or download packages through PIP I get ssl error.

Combining this and this instructions I installed ssl 3.0.7:

curl https://www.openssl.org/source/openssl-3.0.7.tar.gz | tar xz
sudo mv openssl-3.0.7 /usr/local/openssl && cd /usr/local/openssl
sudo make distclean 
sudo ./config -fPIC -shared 
sudo make && sudo install 
vim ~/.profile
Go
export LD_LIBRARY_PATH="/usr/local/openssl/lib:$LD_LIBRARY_PATH"
:wq
sudo ./configure --with-openssl=/usr/local --prefix=/opt/python-3.11.0 

But I got messages about missing ssl in config.log file:

configure:22831: checking for openssl/ssl.h in /usr/src/openssl-3.0.7
configure:22842: result: no
configure:22854: checking whether compiling and linking against OpenSSL works
Trying link with OPENSSL_LDFLAGS=; OPENSSL_LIBS=; OPENSSL_INCLUDES=
configure:22876: gcc -pthread -o conftest      conftest.c  -lpthread -ldl  -lutil >&5
/tmp/cc0rudaM.o: In function `main':
conftest.c:(.text+0xa): undefined reference to `SSL_new'

configure:22911: checking for --with-openssl-rpath
configure:22950: result: 
configure:23003: checking whether OpenSSL provides required ssl module APIs
configure:23035: gcc -pthread -o conftest       conftest.c -lpthread -ldl  -lutil  >&5
conftest.c:416:10: error: #error "OpenSSL >= 1.1.1 is required"
          #error "OpenSSL >= 1.1.1 is required"
configure:23116: checking for --with-ssl-default-suites
configure:23145: result: python

configure:25201: checking for stdlib extension module _ssl
configure:25231: result: missing

ac_cv_working_openssl_hashlib=no
ac_cv_working_openssl_ssl=no
py_cv_module__ssl=missing

MODULE__SSL_FALSE=''
MODULE__SSL_STATE=missing
MODULE__SSL_TRUE='#'
OPENSSL_INCLUDES=''
OPENSSL_LDFLAGS=''
OPENSSL_LIBS=''
OPENSSL_RPATH=''

Also I found all ssl files by this command:

find / -name "ssl" > /home/alex/file.txt

Result:

/home/alex/.config/JetBrains/PyCharm2022.3/ssl
/home/alex/Python-3.11.0/Tools/ssl
/snap/core18/2654/etc/ssl
/snap/core18/2654/usr/lib/ssl
/snap/core18/2667/etc/ssl
/snap/core18/2667/usr/lib/ssl
/snap/snapd/17883/var/lib/snapd/ssl
/snap/snapd/17950/var/lib/snapd/ssl
/var/lib/snapd/ssl
/etc/cups/ssl
/etc/ssl
/usr/local/openssl/ssl
/usr/share/doc/libssl-doc/demos/ssl
/usr/lib/ssl

Do I understand correctly that I should have installed ssl 1.1.1 instead of ssl 3.0.7? Why doesn't python3.5 throw an ssl error unlike python3.11? How do I fix it?

0 Answers0