aboutcode-org / aboutcode-org/scancode-toolkit

ModuleNotFoundError -- 'elftools.common.py3compat' -- after installed `compiledcode`

Đang mở
#4,463 3 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug Priority: high
Ngôn ngữ chính
Python
Star
2.6k
Fork
791
Merge trung bình
1 ngày 12 giờ
Pull request đã merge (30 ngày)
5

Mô tả

### Description

I installed `compiledcode` in the SCTK's venv aiming to use the `--dwarf` plugin
```
(venv) thomas@DESKTOP-6IMEJ77:/mnt/c/Users/thoma/vscode/scancode-toolkit$ pip install compiledcode
```

When I run the `--dwarf` option, I get "ModuleNotFoundError"
```
(venv) thomas@DESKTOP-6IMEJ77:/mnt/c/Users/thoma/vscode/scancode-toolkit$ scancode --dwarf /mnt/c/Users/thoma/Downloads/perl-Event-Lib-1.03-1.el6.rf.i686.rpm-extract/usr/lib/perl5/vendor_perl/auto/Event/Lib/Lib..s --json-pp -
========================================================================
ERROR: UNABLE TO IMPORT SCANCODE PLUGINS.
Check your installation configuration (setup.py) or re-install/re-configure ScanCode.
The following plugin(s) are referenced and cannot be loaded/imported:
No module named 'elftools.common.py3compat'
========================================================================
Traceback (most recent call last):
File "/mnt/c/Users/thoma/vscode/scancode-toolkit/venv/bin/scancode", line 5, in
from scancode.cli import scancode
File "/mnt/c/Users/thoma/vscode/scancode-toolkit/src/scancode/cli.py", line 132, in
raise e
File "/mnt/c/Users/thoma/vscode/scancode-toolkit/src/scancode/cli.py", line 119, in
plugin_classes, plugin_options = PluginManager.load_plugins()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/mnt/c/Users/thoma/vscode/scancode-toolkit/venv/lib/python3.12/site-packages/plugincode/__init__.py", line 199, in load_plugins
mgr_setup = manager.setup()
^^^^^^^^^^^^^^^
File "/mnt/c/Users/thoma/vscode/scancode-toolkit/venv/lib/python3.12/site-packages/plugincode/__init__.py", line 225, in setup
raise e
File "/mnt/c/Users/thoma/vscode/scancode-toolkit/venv/lib/python3.12/site-packages/plugincode/__init__.py", line 223, in setup
self.manager.load_setuptools_entrypoints(entrypoint)
File "/mnt/c/Users/thoma/vscode/scancode-toolkit/venv/lib/python3.12/site-packages/pluggy/_manager.py", line 416, in load_setuptools_entrypoints
plugin = ep.load()
^^^^^^^^^
File "/usr/lib/python3.12/importlib/metadata/__init__.py", line 205, in load
module = import_module(match.group('module'))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/importlib/__init__.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/mnt/c/Users/thoma/vscode/scancode-toolkit/venv/lib/python3.12/site-packages/compiledcode/dwarf/__init__.py", line 27, in
from compiledcode.dwarf import dwarfng
File "/mnt/c/Users/thoma/vscode/scancode-toolkit/venv/lib/python3.12/site-packages/compiledcode/dwarf/dwarfng.py", line 19, in
from elftools.common.py3compat import bytes2str
ModuleNotFoundError: No module named 'elftools.common.py3compat'
(venv) thomas@DESKTOP-6IMEJ77:/mnt/c/Users/thoma/vscode/scancode-toolkit$
```

Note: After installing `compiledcode`, I'm unable to use ScanCode-Toolkit.
Running any `scancode` command, even `scancode -h`, results in a `ModuleNotFoundError`.

### System configuration

* What OS are you running on? (Windows/MacOS/Linux) Windows
* What version of scancode-toolkit was used to generate the scan file? latest from the develop branch
* What installation method was used to install/run scancode? (pip/source download/other) git clone

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.