AttributeError: module 'pip' has no attribute 'get_installed_distributions'
- Dominant language
- Python
- Stars
- 170
- Forks
- 189
- PR merge metrics
- No merged PRs in 30d
Description
I am trying to build from the von-network source code.
Image used:
bcgovimages/von-image:node-1.12-6
My Environment:
--------------------------
Windows 10
Docker Desktop with WSL2 enabled
git-bash
local python 3.10
Snippets of logs that are generated after running the command:
./manage start --logs
webserver_1 |
webserver_1 | Traceback (most recent call last):
webserver_1 | File "/home/indy/.pyenv/versions/3.6.13/lib/python3.6/runpy.py", line 193, in _run_module_as_main
webserver_1 | "__main__", mod_spec)
webserver_1 | File "/home/indy/.pyenv/versions/3.6.13/lib/python3.6/runpy.py", line 85, in _run_code
webserver_1 | exec(code, run_globals)
webserver_1 | File "/home/indy/server/server.py", line 14, in
webserver_1 | from .anchor import (
webserver_1 | File "/home/indy/server/anchor.py", line 19, in
webserver_1 | from plenum.common.signer_simple import SimpleSigner
webserver_1 | File "/home/indy/.pyenv/versions/3.6.13/lib/python3.6/site-packages/plenum/__init__.py", line 87, in
webserver_1 | setup_plugins()
webserver_1 | File "/home/indy/.pyenv/versions/3.6.13/lib/python3.6/site-packages/plenum/__init__.py", line 60, in setup_plugins
webserver_1 | installed_packages = {p.project_name: p for p in pip.get_installed_distributions()}
webserver_1 | AttributeError: module 'pip' has no attribute 'get_installed_distributions'
von_node4_1 exited with code 1
Note: I checked the 'plenum' code in its repository, it doesn't have the pip related instructions at line 60:
installed_packages = set(p.metadata["Name"] for p in importlib_metadata.distributions())
Please look into this.
Thanks
Contributor guide
Research direction
Reproduce the failure with ./manage start --logs using the reported Docker image and environment. Start at server/anchor.py, then follow the import into plenum/__init__.py around setup_plugins and the pip.get_installed_distributions call. Done means the webserver and von_node containers start without this AttributeError, with the relevant dependency behavior covered by an appropriate test if one exists.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100