Issue with openssl versioning on python run on the cloudshell

Since this morning me and my colleagues have issues running a number of python packages on the gcloud cloudshell. We are experiencing import error related to OpenSSL.

ImportError: libssl.so.1.1: cannot open shared object file: No such file or directory. It seems that a number of python packages were expecting OpenSSL 1.1.x. However, running openssl version shows that version 3.0.2 is installed.

We have tried updating some package requirements which seems to work for some packages, however it didn't seem to work for packages dependent on lib\ssl.py.

installing an older version of OpenSSL and libffi7(which was also missing) resolves the import errors temporarily, but such changes do no persists on the cloudshell.

I have two questions:

1) Is there a way to solve such issues in a persistent way?

2) Is there any chance these issues might pop up in our production app (App engine running flask, that installs ubuntu-latest at deployment)

4 1 86
1 REPLY 1

Hello @anne_de_beurs,

Welcome to the Google Cloud Community!

To solve your issue consistently:

1. Update pip to the latest version by running pip install --upgrade pip. This helps with handling dependencies for newer OpenSSL versions.
2. Use specific version numbers in your requirements.txt file to ensure all packages are compatible with OpenSSL 3. This maintains consistency across different environments.

For further guidance, refer to this StackOverflow post: libssl.so.1.1 cannot open shared object file.

You can also check this GitHub discussion: PaddlePaddle OpenSSL Issue.

Top Labels in this Space