How can I fix OpenSSL error when importing a package in a Python notebook in ArcGIS?

261 Views Asked by At

I receive the following error when trying to import a specific package (geemap) into a python notebook:

Exception: OpenSSL 3.0's legacy provider failed to load. This is a fatal error by default, but cryptography supports running without legacy algorithms by setting the environment variable CRYPTOGRAPHY_OPENSSL_NO_LEGACY. If you did not expect this error, you have likely made a mistake with your OpenSSL configuration.

I confirmed that the package is installed and I am not having issues with importing other packages. Any suggestions on how to address this and what the source of the issue is? Thank you!

I tried setting the environment variable using: os.environ[CRYPTOGRAPHY_OPENSSL_NO_LEGACY] ="1", but received a NameError.

1

There are 1 best solutions below

0
On

While I don't understand why I received that error, the solution ended up being very simple. I restarted ArcGIS and corrected the typo:

import os
os.environ["CRYPTOGRAPHY_OPENSSL_NO_LEGACY"] ="yes"
import geemap

That was it.