Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: cannot import name 'get_installed_distributions' from 'pip' #382

Open
FalcoGer opened this issue Nov 7, 2022 · 1 comment

Comments

@FalcoGer
Copy link

FalcoGer commented Nov 7, 2022

I have upgraded to python3.10 with pip version 22.3.1. I tried using this tool again and tried to upgrade it, but now I get the following error message.

pip3 install -U osrframework
# [output, no errors]
osrf -h
Traceback (most recent call last):
  File "/home/username/.local/lib/python3.10/site-packages/osrframework/utils/updates.py", line 22, in <module>
    from pip._internal.utils.misc import get_installed_distributions
ImportError: cannot import name 'get_installed_distributions' from 'pip._internal.utils.misc' (/home/username/.local/lib/python3.10/site-packages/pip/_internal/utils/misc.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/username/.local/bin/osrf", line 5, in <module>
    from osrframework.launcher import main
  File "/home/username/.local/lib/python3.10/site-packages/osrframework/launcher.py", line 33, in <module>
    import osrframework.upgrade as upgrade
  File "/home/username/.local/lib/python3.10/site-packages/osrframework/upgrade.py", line 30, in <module>
    from osrframework.utils.updates import UpgradablePackage
  File "/home/username/.local/lib/python3.10/site-packages/osrframework/utils/updates.py", line 24, in <module>
    from pip import get_installed_distributions
ImportError: cannot import name 'get_installed_distributions' from 'pip' (/home/username/.local/lib/python3.10/site-packages/pip/__init__.py)
@FalcoGer
Copy link
Author

FalcoGer commented Nov 7, 2022

Temporary workaround is to have a virtual environment (virtualenv) and downgrading pip with pip install -U 'pip<21.3'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant