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

pip-licenses broken in python 3.11 #128

Closed
b-kamphorst opened this issue Oct 25, 2022 · 5 comments
Closed

pip-licenses broken in python 3.11 #128

b-kamphorst opened this issue Oct 25, 2022 · 5 comments

Comments

@b-kamphorst
Copy link
Contributor

pip-licenses is broken in python 3.11 for pip>=22.1.

The issue is roughly the same as in #113. Log:

$ pip-licenses
Traceback (most recent call last):
  File "/builds/gitlab/.../.venv/bin/pip-licenses", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/builds/gitlab/.../stubs/.venv/lib/python3.11/site-packages/piplicenses.py", line 900, in main
    output_string = create_output_string(args)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builds/gitlab/.../stubs/.venv/lib/python3.11/site-packages/piplicenses.py", line 558, in create_output_string
    table = create_licenses_table(args, output_fields)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builds/gitlab/.../stubs/.venv/lib/python3.11/site-packages/piplicenses.py", line 303, in create_licenses_table
    for pkg in get_packages(args):
  File "/builds/gitlab/.../stubs/.venv/lib/python3.11/site-packages/piplicenses.py", line 2[54](...), in get_packages
    pkg_name = pkg.project_name
               ^^^^^^^^^^^^^^^^
AttributeError: 'PathDistribution' object has no attribute 'project_name'
@b-kamphorst
Copy link
Contributor Author

#116 attempts to solve this issue with setuptools. I'm no expert, but perhaps importlib.metadata can be considered (built-in)?

@raimon49
Copy link
Owner

A release candidate version that works well with Python 3.11 is available thanks to bart's contribution.
https://pypi.org/project/pip-licenses/4.0.0rc1/

Users who wish to try this version before the official release should install it with pip.Feedback on running it in different environments is welcome.

$ pip install 'pip-licenses==4.0.0rc1'   

@nejch
Copy link

nejch commented Oct 27, 2022

@raimon49 I just opened this issue and your comment popped up a few seconds after :)

I installed the rc1 and this works for me on 3.11.

@raimon49
Copy link
Owner

RC2 is now available following bug reports and patches. #132

pip install 'pip-licenses==4.0.0rc2'

We continue to welcome feedback.

@raimon49
Copy link
Owner

raimon49 commented Nov 6, 2022

pip-licenses 4.0.0 has been officially released. Thank you all for your contributions.
https://pypi.org/project/pip-licenses/4.0.0/

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

3 participants