Install & Compatibility
Where this runs
tested against v32.5.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
py 3.11
✕ build_error
✓ 20.9s
py 3.12
✕ build_error
✓ 19.4s
py 3.9
✕ timeout
✕ build_error
726MB installed
● package 726MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Scanner
✓ from scancode.cli import Scanner
Scanner is the main CLI class; direct import from scancode.cli
JsonResults
✓ from scancode.output import JsonResults
Used to generate JSON output
Basic scan for licenses and copyrights on a directory. The scanner returns a results object; call as_json() to get JSON output.
import os
from scancode.cli import Scanner
scanner = Scanner()
results = scanner.scan('path/to/scan', options={'--license': True, '--copyright': True})
print(results.as_json())
scancode --version
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'scancode'
Installing the wrong package or missing installed scancode-toolkit.
fixRun: pip install scancode-toolkit
AttributeError: 'NoneType' object has no attribute 'as_json'
scan() returned None because of invalid path or missing options.
fixEnsure the path exists and you pass valid options like '--license' and '--copyright' as a dictionary.
ValueError: Unknown option: --package-in-compiled
Using an older version of scancode that doesn't have that option.
fixUpgrade scancode-toolkit to >=32.5.0
Upgrade
Version history
32.5.0latest on PyPI · released Jan 15, 2026
Audit
Dependencies
pluggyrequiredPlugin system core
license-expressionrequiredSPDX license expression parsing