extractcode-libarchive
raw JSON → 3.5.1.210531 verified Fri May 01 auth: no python
A ScanCode path provider plugin that provides a prebuilt native libarchive binary for archive extraction. Version 3.5.1.210531 is current. Release cadence is irregular, tied to ScanCode plugin updates.
pip install extractcode-libarchive Common errors
error ModuleNotFoundError: No module named 'extractcode.libarchive' ↓
cause Incorrect import path: using dot instead of underscore.
fix
Change import to
from extractcode_libarchive import ... error AttributeError: module 'extractcode_libarchive' has no attribute 'get_libarchive' ↓
cause Outdated version or incorrect import. The function may have been renamed or removed.
fix
Upgrade to latest version:
pip install --upgrade extractcode-libarchive. Verify API docs. Warnings
gotcha This package only provides a prebuilt binary. It does not include the libarchive Python bindings. You must separately install e.g., libarchive-c or pylibarchive to use the binary programmatically. ↓
fix Install a library like `libarchive-c` (`pip install libarchive-c`) and use `ctypes` or the library's API to load the binary from the path returned by `get_libarchive()`.
gotcha The import path uses underscore (`extractcode_libarchive`) not dot (`extractcode.libarchive`). A common mistake is to assume it's a subpackage. ↓
fix Use `from extractcode_libarchive import ...`
gotcha This plugin is packaged for use with ScanCode toolkit. Standalone usage may require additional setup for plugin discovery. ↓
fix Ensure `plugincode` is installed and the environment includes the ScanCode plugin registry.
Imports
- get_libarchive wrong
from extractcode.plugins import get_libarchivecorrectfrom extractcode_libarchive import get_libarchive - LibarchiveExtractor
from extractcode_libarchive import LibarchiveExtractor
Quickstart
from extractcode_libarchive import get_libarchive
# Get path to the embedded libarchive binary
libarchive_path = get_libarchive()
print(libarchive_path)
# Output: '/path/to/libarchive/binary'