New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ModuleNotFound error: No module named '_ssl' for python 3.10.x and 3.11.x in amazonlinux:2 Docker #2760
Comments
Python 3.10+ requires OpenSSL 1.1.1+ |
It seems like this works: yum remove openssl-devel
yum install openssl11-devel
pyenv install 3.9 I've also had this saved for years, to install OpenSSL 1.1.1 from source, under wget https://github.com/openssl/openssl/archive/OpenSSL_1_1_1.tar.gz
tar -xvzf OpenSSL_1_1_1.tar.gz
cd openssl-OpenSSL_1_1_1/
./config --prefix=$HOME
make
make install
cd ..
CFLAGS="-I$HOME/include" LDFLAGS="-L$HOME/lib" pyenv install 3.7.4 hopefully that's not necessary anymore(?). This is my full script for Amazon Linux, updated to specify curl https://pyenv.run | bash
sudo yum update -y
sudo yum install -y gcc git zlib-devel openssl11-devel libffi-devel bzip2-devel ncurses-devel readline-devel xz-devel sqlite-devel
pyenv install 3.11.6 Is there an easier way? Update: today (on more recent AZLinux? 6.1.77-99.164?) curl https://pyenv.run | bash
sudo yum update -y
sudo yum install -y gcc git zlib-devel openssl-devel libffi-devel bzip2-devel ncurses-devel readline-devel xz-devel sqlite-devel
pyenv install 3.11.8 |
@ryan-williams Since about 3.9, CPython supports OpenSSL 3, the support is official since 3.11.5 . So you don't need 1.1 anymore. |
Are you serious? That's mean windows builds and macOS installers. |
Not works on el7 |
They never made any kind of official announcement about OpenSSL 3.0 support stage (when it was first added, it was considered experimental and one of the core devs told us about a year ago that it still was) so we have to guess. Starting to ship their prebuilt releases with this version is the closest thing to an official announcement. |
Description
Hi, I use the following dockerfile to create a docker image.
The issue I am having is that this file has successfully installed python 3.8.11 and 3.9.16. However it encountered the error if I tried to install version 3.10.x and 3.11.x. The following is the error message for python version 3.10.1:
I did look at the the common problems here [https://github.com/pyenv/pyenv/wiki/Common-build-problems]. But it is not very helpful in my case since this dockerfile is good for both python 3.8.x and 3.9.x. Can anyone help take a look at it? Thanks.
The text was updated successfully, but these errors were encountered: