Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Path for scancode is not found #3422

Closed
LaurentChion opened this issue Dec 7, 2020 · 2 comments
Closed

Path for scancode is not found #3422

LaurentChion opened this issue Dec 7, 2020 · 2 comments
Labels
invalid An issue that is deemed to be invalid scanner About the scanner tool

Comments

@LaurentChion
Copy link

Hi,

I have just compile and run ort but I have an issue with the scanner:

❯ ~/Software/ort/cli/build/install/ort/bin/ort --info scan -i ./ort/analyzer-result.json -o ./ort/
________ _____________________
\_____  \\______   \__    ___/ the OSS Review Toolkit, version 265fc48.
 /   |   \|       _/ |    |
/    |    \    |   \ |    |    Running 'scan' under Java 14.0.2 on Linux with
\_______  /____|_  / |____|    4 CPUs and a maximum of 1842 MiB of memory.
        \/       \/
Environment variables:
ORT_CONFIG_DIR = /home/laurent/.ort/config
ORT_DATA_DIR = /home/laurent/.ort
SHELL = /usr/bin/zsh
TERM = xterm-256color
GOPATH = /home/laurent/go

07:57:21.815 [main] INFO  org.ossreviewtoolkit.scanner.ScanResultsStorage - ScanResultStorage has been configured to FileBasedStorage with XZCompressedLocalFileStorage backend.
Using scanner 'ScanCode' with storage 'FileBasedStorage with XZCompressedLocalFileStorage backend'.
Local file storage has 0 scan results files.
07:57:25.130 [main] INFO  org.ossreviewtoolkit.scanner.LocalScanner - Bootstrapping scanner 'ScanCode' as expected version 3.2.1-rc2 was not found in PATH.
07:57:25.131 [main] INFO  org.ossreviewtoolkit.scanner.scanners.ScanCode - Downloading ScanCode from https://github.com/nexB/scancode-toolkit/archive/v3.2.1rc2.tar.gz...
07:57:26.222 [main] INFO  org.ossreviewtoolkit.scanner.scanners.ScanCode - Retrieved ScanCode from local cache.
07:57:27.129 [main] INFO  org.ossreviewtoolkit.scanner.scanners.ScanCode - Unpacking '/tmp/ort816142540179524831ScanCode-v3.2.1rc2.tar.gz' to '/tmp/ort-ScanCode-3.2.1-rc28939431382011693687'...
07:57:31.593 [main] INFO  org.ossreviewtoolkit.utils.ProcessCapture - Running '/tmp/ort-ScanCode-3.2.1-rc28939431382011693687/scancode-toolkit-3.2.1rc2/scancode --version' in '/tmp/ort-ScanCode-3.2.1-rc28939431382011693687/scancode-toolkit-3.2.1rc2'...
Exception in thread "main" java.io.IOException: Running '/tmp/ort-ScanCode-3.2.1-rc28939431382011693687/scancode-toolkit-3.2.1rc2/scancode --version' in '/tmp/ort-ScanCode-3.2.1-rc28939431382011693687/scancode-toolkit-3.2.1rc2' failed with exit code 127:
ERROR: Could not find a version that satisfies the requirement future>=0.16.0 (from scancode-toolkit==3.2.1rc2->-r /tmp/ort-ScanCode-3.2.1-rc28939431382011693687/scancode-toolkit-3.2.1rc2/etc/conf/requirements_base.txt (line 1)) (from versions: none)
ERROR: No matching distribution found for future>=0.16.0 (from scancode-toolkit==3.2.1rc2->-r /tmp/ort-ScanCode-3.2.1-rc28939431382011693687/scancode-toolkit-3.2.1rc2/etc/conf/requirements_base.txt (line 1))
Traceback (most recent call last):
  File "/tmp/ort-ScanCode-3.2.1-rc28939431382011693687/scancode-toolkit-3.2.1rc2/etc/configure.py", line 562, in <module>
    install_3pp(configs, root_dir, thirdparty_dirs, quiet=quiet)
  File "/tmp/ort-ScanCode-3.2.1-rc28939431382011693687/scancode-toolkit-3.2.1rc2/etc/configure.py", line 286, in install_3pp
    run_pip(requirements, root_dir, tpp_dirs, quiet)
  File "/tmp/ort-ScanCode-3.2.1-rc28939431382011693687/scancode-toolkit-3.2.1rc2/etc/configure.py", line 312, in run_pip
    call(pcmd, root_dir)
  File "/tmp/ort-ScanCode-3.2.1-rc28939431382011693687/scancode-toolkit-3.2.1rc2/etc/configure.py", line 158, in call
    subprocess.check_call(cmd, shell=True, env=dict(os.environ), cwd=root_dir)
  File "/home/laurent/Software/miniconda3/lib/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '"/tmp/ort-ScanCode-3.2.1-rc28939431382011693687/scancode-toolkit-3.2.1rc2/bin/pip" install --upgrade --no-index --no-cache-dir --find-links="/tmp/ort-ScanCode-3.2.1-rc28939431382011693687/scancode-toolkit-3.2.1rc2/thirdparty/dev" --find-links="/tmp/ort-ScanCode-3.2.1-rc28939431382011693687/scancode-toolkit-3.2.1rc2/thirdparty" -qq --requirement "/tmp/ort-ScanCode-3.2.1-rc28939431382011693687/scancode-toolkit-3.2.1rc2/etc/conf/requirements_base.txt"' returned non-zero exit status 1.
/tmp/ort-ScanCode-3.2.1-rc28939431382011693687/scancode-toolkit-3.2.1rc2/scancode: line 114: /tmp/ort-ScanCode-3.2.1-rc28939431382011693687/scancode-toolkit-3.2.1rc2/bin/scancode: No such file or directory

It looks like /tmp/ort-ScanCode-3.2.1-rc28939431382011693687/scancode-toolkit-3.2.1rc2/bin/scancode does not exist so I looked at the downloaded folder and indeed there is no scancode:

ort-ScanCode-3.2.1-rc28939431382011693687/scancode-toolkit-3.2.1rc2/bin via 🐍 v3.8.3 via C base
❯ ls
activate      activate.fish  activate_this.py  easy_install   easy_install-3.8  pip3     pip3.8  python3    wheel   wheel-3.8
activate.csh  activate.ps1   activate.xsh      easy_install3  pip               pip-3.8  python  python3.8  wheel3

I manage to find it in the previous folder:

/tmp/ort-ScanCode-3.2.1-rc28939431382011693687/scancode-toolkit-3.2.1rc2 via 🐍 v3.8.3 via C base
❯ ls
apache-2.0.LICENSE   bin              CODE_OF_CONDUCT.rst  CONTRIBUTING.rst  extractcode.bat  NOTICE           README.rst    scancode-toolkit.ABOUT  tests
appveyor.yml         cc0-1.0.LICENSE  configure            docs              INSTALL.rst      plugins          samples       setup.cfg               thirdparty
AUTHORS.rst          CHANGELOG.rst    configure.bat        etc               lib              plugins-builtin  scancode      setup.py
azure-pipelines.yml  codecov.yml      conftest.py          extractcode       MANIFEST.in      pyvenv.cfg       scancode.bat  src
@sschuberth
Copy link
Member

The important lines are

ERROR: Could not find a version that satisfies the requirement future>=0.16.0 (from scancode-toolkit==3.2.1rc2->-r /tmp/ort-ScanCode-3.2.1-rc28939431382011693687/scancode-toolkit-3.2.1rc2/etc/conf/requirements_base.txt (line 1)) (from versions: none)
ERROR: No matching distribution found for future>=0.16.0 (from scancode-toolkit==3.2.1rc2->-r /tmp/ort-ScanCode-3.2.1-rc28939431382011693687/scancode-toolkit-3.2.1rc2/etc/conf/requirements_base.txt (line 1))

So the bootstrapped ScanCode fails to configure itself, probably due to an unsupported Python version on your side. Indeed, from the paths it seems you're using Python 3.8, which is not yet supported by ScanCode (actually, there several ScanCode issues about the Python version).

@sschuberth sschuberth added invalid An issue that is deemed to be invalid scanner About the scanner tool labels Dec 7, 2020
@LaurentChion
Copy link
Author

Thank you, looks like it works with python 3.6 (its running at the moment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid An issue that is deemed to be invalid scanner About the scanner tool
Projects
None yet
Development

No branches or pull requests

2 participants