"ssl module in Python is not available" when installing package with pip3
Step by step guide to install Python 3.6 and pip3 in Ubuntu
Install the necessary packages for Python and ssl:
$ sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev
Download and unzip "Python-3.6.8.tar.xz" from https://www.python.org/ftp/python/ into your home directory.
Open terminal in that directory and run:
$ ./configure
Build and install:
$ make && sudo make install
Install packages with:
$ pip3 install package_name
Disclaimer: The above commands are not tested in Ubuntu 20.04 LTS.
If you are on Windows and use anaconda this worked for me:
I tried a lot of other solutions which did not work (Environment PATH Variable changes ...)
The problem can be caused by DLLs in the Windows\System32 folder (e.g. libcrypto-1_1-x64.dll or libssl-1_1-x64.dll or others) placed there by other software.
The fix was installing openSSL from https://slproweb.com/products/Win32OpenSSL.html which replaces the dlls by more recent versions.
If you are on Red Hat/CentOS:
# To allow for building python ssl libsyum install openssl-devel# Download the source of *any* python versioncd /usr/srcwget https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tar.xztar xf Python-3.6.2.tar.xz cd Python-3.6.2# Configure the build w/ your installed libraries./configure# Install into /usr/local/bin/python3.6, don't overwrite global python binmake altinstall