Closed tejaschumbalkar closed 1 year ago
Thanks for the information.
There is a part in the test code that mocks get_installed_distributions()
. It needs to be fixed before merging.
Any hope in seeing a fix for this issue merged in? Using pip=21.3.1
, it throws an exception:
File ".venv\Scripts\pip-licenses.exe\__main__.py", line 4, in <module>
File ".venv\lib\site-packages\piplicenses.py", line 44, in <module>
from pip import get_installed_distributions
ImportError: cannot import name 'get_installed_distributions' from 'pip' (.venv\lib\site-packages\pip\__init__.py)
@jpmn I haven't decided if I want to merge this PR or not.
Please install the latest version of pip-licenses in your environment and see if it solves the error.
# Update pip-licenses version to 3.5.3 or later
$ pip install -U pip-licenses
I am using the latest version of pip-licenses
, but I had to freeze my pip
version until there is a fix. I might consider dropping the library in the medium-term if it is blocking my upgrade of pip
.
Don't you experience the same behavior with more recent versions of pip
?
This fix is required for many users, it is not acceptable to pin the pip version for a such long time. Is there road map to support pip >= 22?
@worroc Who are "many users"? If this is about you, we need information about your environment.
At least in my environment it is working with pip 22.x.
$ pip-licenses --with-system
Name Version License
PTable 0.9.2 BSD License
botocore 1.21.53 Apache Software License
jmespath 0.10.0 MIT License
pip 22.2.2 MIT License
pip-licenses 3.5.3 MIT License
This proposal was superseded by another excellent proposal that uses importlib_metadata.
Issue: #113
Reference function using setuptools instead of pip internal function. Reference: https://github.com/pypa/pip/issues/5243