dhatim/python-license-check

pkg_resources.DistributionNotFound: The 'None' distribution was not found and is required by the application

egegunes opened this issue · 4 comments

I get the following error when I try to run liccheck -s strategy.ini -r requirements.txt:

gathering licenses...
Traceback (most recent call last):
  File "/home/egegunes/Dev/arcelik/3d-backend/venv/bin/liccheck", line 11, in <module>
    load_entry_point('liccheck==0.3.12', 'console_scripts', 'liccheck')()
  File "/home/egegunes/Dev/arcelik/3d-backend/venv/lib64/python3.7/site-packages/liccheck/command_line.py", line 264, in main
    sys.exit(run(args))
  File "/home/egegunes/Dev/arcelik/3d-backend/venv/lib64/python3.7/site-packages/liccheck/command_line.py", line 259, in run
    return process(args.requirement_txt_file, strategy, args.level)
  File "/home/egegunes/Dev/arcelik/3d-backend/venv/lib64/python3.7/site-packages/liccheck/command_line.py", line 182, in process
    pkg_info = get_packages_info(requirement_file)
  File "/home/egegunes/Dev/arcelik/3d-backend/venv/lib64/python3.7/site-packages/liccheck/command_line.py", line 103, in get_packages_info
    packages = [transform(dist) for dist in pkg_resources.working_set.resolve(requirements)]
  File "/home/egegunes/Dev/arcelik/3d-backend/venv/lib64/python3.7/site-packages/pkg_resources/__init__.py", line 786, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'None' distribution was not found and is required by the application

strategy.ini

# Authorized and unauthorized licenses in LOWER CASE
[Licenses]
authorized_licenses:
        bsd
        new bsd
        bsd license
        new bsd license
        simplified bsd
        apache
        apache 2.0
        apache software license
        gnu lgpl
        lgpl with exceptions or zpl
        isc license
        isc license (iscl)
        mit
        mit license
        python software foundation license
        zpl 2.1

unauthorized_licenses:
        gpl v3

requirements.txt

applicationinsights
azure-batch==6.0.0
azure-storage-blob==1.4.0
celery==4.2.1
Django==2.2
django-cors-headers==2.4.0
django-environ==0.4.5
djangorestframework==3.9.0
gunicorn
psycopg2-binary
requests
whitenoise

git+https://github.com/jazzband/django-oauth-toolkit.git@846ab0ba8acaa3e4870b424700544aa6329511e4

Same issue, doesn't work for me even for the example on python 2.7
Seems to work on python 3.7

I have the same issue, but on further inspection, I found that I had "-e ." flag in my requirements.txt which was causing the error.

I still think this is an issue and needs attention.

Works OK for me in liccheck==0.3.12 when I add a suffix #egg=package-name.
Working:

git+https://github.com/OWNER/foo-bar.git#egg=foo-bar

Not working:

git+https://github.com/OWNER/foo-bar.git

Works OK for me in liccheck==0.3.12 when I add a suffix #egg=package-name.
Working:

git+https://github.com/OWNER/foo-bar.git#egg=foo-bar

Not working:

git+https://github.com/OWNER/foo-bar.git

I had this issue too and your fix helped thanks. I wonder if it should be documented in the readme for Github pip dependencies?