Skip to content

Commit

Permalink
utils.py: bypass ModuleNotFound for pip_install
Browse files Browse the repository at this point in the history
Module names are too often different from package names..
  • Loading branch information
darosior committed Dec 25, 2019
1 parent e0cf950 commit 85f00ad
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,11 @@ def pip_install(package):
import_module(package_name)
.__version__)
if package_version > installed_version:
# MUST NOT fail
subprocess.check_output([sys.executable, "-m", "pip",
"install", package])
except AttributeError:
# No __version__ ..
pass
except ModuleNotFoundError:
# If the package name is different from the module name
pass

0 comments on commit 85f00ad

Please sign in to comment.