diff --git a/paddlehub/utils/pypi.py b/paddlehub/utils/pypi.py index 7a035d4af7038554389843336e2ab5c07dbd4d74..8f0f3c68c4a254138b0d647b81d484803735ede6 100644 --- a/paddlehub/utils/pypi.py +++ b/paddlehub/utils/pypi.py @@ -15,7 +15,6 @@ import os import subprocess -from pip._internal.utils.misc import get_installed_distributions from typing import IO from paddlehub.utils.utils import Version @@ -24,6 +23,7 @@ from paddlehub.utils.io import discard_oe, typein def get_installed_packages() -> dict: '''Get all packages installed in current python environment''' + from pip._internal.utils.misc import get_installed_distributions return {item.key: Version(item.version) for item in get_installed_distributions()}