diff --git a/enterprise_gateway/services/processproxies/processproxy.py b/enterprise_gateway/services/processproxies/processproxy.py index a3df58b12..7c7073c7a 100644 --- a/enterprise_gateway/services/processproxies/processproxy.py +++ b/enterprise_gateway/services/processproxies/processproxy.py @@ -27,7 +27,11 @@ from jupyter_client import launch_kernel, localinterfaces from notebook import _tz from zmq.ssh import tunnel -from Cryptodome.Cipher import AES + +try: + from Cryptodome.Cipher import AES +except ImportError: + from Crypto.Cipher import AES from ..sessions.kernelsessionmanager import KernelSessionManager diff --git a/etc/kernel-launchers/python/scripts/launch_ipykernel.py b/etc/kernel-launchers/python/scripts/launch_ipykernel.py index 963674a26..48bbb6aa4 100644 --- a/etc/kernel-launchers/python/scripts/launch_ipykernel.py +++ b/etc/kernel-launchers/python/scripts/launch_ipykernel.py @@ -11,7 +11,11 @@ from random import random from threading import Thread -from Cryptodome.Cipher import AES +try: + from Cryptodome.Cipher import AES +except ImportError: + from Crypto.Cipher import AES + from ipython_genutils.py3compat import str_to_bytes from jupyter_client.connect import write_connection_file