aboutcode-org / aboutcode-org/scancode-toolkit
Accesses gemfileparser which is not installed
- 主要語言
- Python
- 星號
- 2.6k
- 分支
- 791
- 平均合併
- 1 天 12 小時
- 30 天內合併 PR
- 5
描述
### Description
Installation of scancode-toolkit using pip (version 32.2.1) also installs gemfileparser2, but code still depends on gemfileparser, which is not installed automatically.
File `spec.py` imports from `gemfileparser`, not from `gemfileparser2`.
### How To Reproduce
In a python environment with all the necessary OS libraries, e. g. a docker container for image python:3.9-slim:
```
# I started in a directory /app
# mkdir /app
# cd /app
python -m venv venv-scancode
. venv-scancode/bin/activate
pip install --upgrade pip
pip install wheel
pip install scancode-toolkit
./venv-scancode/bin/scancode --example
```
Results in
```
========================================================================
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 'gemfileparser'
========================================================================
Traceback (most recent call last):
File "/app/./venv-scancode/bin/scancode", line 5, in
from scancode.cli import scancode
File "/app/venv-scancode/lib/python3.9/site-packages/scancode/cli.py", line 126, in
raise e
File "/app/venv-scancode/lib/python3.9/site-packages/scancode/cli.py", line 113, in
plugin_classes, plugin_options = PluginManager.load_plugins()
File "/app/venv-scancode/lib/python3.9/site-packages/plugincode/__init__.py", line 196, in load_plugins
mgr_setup = manager.setup()
File "/app/venv-scancode/lib/python3.9/site-packages/plugincode/__init__.py", line 222, in setup
raise e
File "/app/venv-scancode/lib/python3.9/site-packages/plugincode/__init__.py", line 220, in setup
self.manager.load_setuptools_entrypoints(entrypoint)
File "/app/venv-scancode/lib/python3.9/site-packages/pluggy/_manager.py", line 287, in load_setuptools_entrypoints
plugin = ep.load()
File "/usr/local/lib/python3.9/importlib/metadata.py", line 86, in load
module = import_module(match.group('module'))
File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/app/venv-scancode/lib/python3.9/site-packages/packagedcode/__init__.py", line 24, in
from packagedcode import cocoapods
File "/app/venv-scancode/lib/python3.9/site-packages/packagedcode/cocoapods.py", line 21, in
from packagedcode import spec
File "/app/venv-scancode/lib/python3.9/site-packages/packagedcode/spec.py", line 12, in
from gemfileparser import GemfileParser
ModuleNotFoundError: No module named 'gemfileparser'
```
After
```
pip install gemfileparser
```
calling scancode again succeeds.
### System configuration
* Linux
* scancode-toolkit version 32.2.1
* installation method pip
貢獻指南
評估
這個 Issue 還沒有評估資料。