From ddb99a14e5933ffcadf230f6d74cf8c6444edbbe Mon Sep 17 00:00:00 2001 From: imbeacon Date: Tue, 30 Jan 2024 10:53:57 +0200 Subject: [PATCH] Added check before installation --- sdk_utils.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/sdk_utils.py b/sdk_utils.py index a98d8ec..29093c7 100644 --- a/sdk_utils.py +++ b/sdk_utils.py @@ -20,10 +20,17 @@ from utils import install_package + try: - install_package('mmh3') -except CalledProcessError: - install_package('pymmh3') + from mmh3 import hash, hash128 +except ImportError: + try: + from pymmh3 import hash, hash128 + except ImportError: + try: + install_package('mmh3') + except CalledProcessError: + install_package('pymmh3') try: from mmh3 import hash, hash128