scancode-toolkit
scancode-toolkit copied to clipboard
Scancode installation via PIP fails with extractcode error
Description
I am trying to install Scancode 32.0.8 locally in my MacBook (m1) using
python3 -m pip install /Users/iliou/Downloads/scancode-toolkit-32.0.8
and I am getting the following message:
ERROR: Could not find a version that satisfies the requirement extractcode-7z>=16.5.210525; extra == "full" (from extractcode[full]) (from versions: none)
ERROR: No matching distribution found for extractcode-7z>=16.5.210525; extra == "full"
I tried to run the default pip command but for some reason version 32.0.2 is being installed instead of the latest one.
System configuration
For bug reports, it really helps us to know:
- What OS are you running on? MacOs M1
- What installation method was used to install/run scancode? pip
- python version: tried with both 3.11 and 3.12
- pip version: 23.3.2
Hi @dimitris-iliou ,
I believe this might be a python version issue.
I have tried running the below commands in both Windows(with Python 3.11.5) and Ubuntu(with Python 3.10.12) machines. Both machines have pip version 23.3.2.
I have tried the below command in both the above mentioned machines.
pip install scancode-toolkit
This successfully installs the scancode-toolkit==32.0.8
. If you want a specific version then use below command.
pip install scancode-toolkit==32.0.8
You can try with python 3.12 version first. If it doesn't work you can try the same with 3.11.6 or 3.11.5 or else try with 3.10.12.
@dimitris-iliou Ran into the same extractcode but with the help of @heliocastro I was abke to get ScanCode running in my M2 Pro
Prerequisites
Installation instructions
-
brew install pyenv pyenv-virtualenv libmagic
- Add to your ~/.zshrc
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
export PYENV_VIRTUALENV_DISABLE_PROMPT=1
eval "$(pyenv init --path)"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
Restart shell or run the command:
source ~/.zshrc
Alternatively if you are using bash add to your ~/.bash_profile or ~/.zprofile
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
Restart shell or run the command:
source ~/.bash_profile
or
source ~/.zprofile
Source: https://stackoverflow.com/questions/45577194/failed-to-activate-virtualenv-with-pyenv
- Ensure you have Python 3.11 install e.g.
pyenv install 3.11.9
- Create virtual environment for ScanCode
pyenv virtualenv 3.11.9 scancode
- Activate new scancode virtual environment using
pyenv activate scancode
- Install scancode via pip using
pip install --no-binary :all scancode-toolkit-mini===32.1.0
- Type
pyenv which scancode
in terminal to see location of scancode executable - if you want scancode to be globally available typepyenv global scancode
.
Now you need to remember to execute pyenv activate scancode` anytime before you want to use ScanCode
There's a correction on the source line, is:
source ~/.zshrc
@heliocastro Thank you for pointing out the needed correction - I have now updated my comment to fix it