spdx / spdx-license-matcher

A tool to match license text with SPDX license list using a an algorithm with finds close matches. It follows SPDX Matching guidelines to keep the substantial text as well as ignore the replaceable text for matching purposes.
Other
27 stars 14 forks source link

import headers show error while running the python files #2

Open HaripriyaB opened 4 years ago

HaripriyaB commented 4 years ago

When the installation was done as per the instructions in the README.md file the following error occurred:

Traceback (most recent call last):
  File "build_licenses.py", line 6, in <module>
    from .normalize import normalize
ImportError: attempted relative import with no known parent package

Note: The similar issue was occurring for all the python files. Possible cause of this error was the import format :

from .normalize import normalize
from .utils import compressStringToBytes

Due to the dot after the python files name it was showing error.

Version : Python 3.7.7

kkoehne commented 4 years ago

I had the same issue. A workaround is to not run the .py files directly, but from top directory:

python -m spdx_license_matcher.matcher