Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Shap installation

I am facing an issue when trying to install shop in a python virtual environment. In particular when

pip install shap

the following error appears:

 ERROR: Command errored out with exit status 1:
   command: /Users/federiconutarelli/Desktop/Riccaboni_python/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/86/wyxlz8f56nq997hwmvpnt_km0000gn/T/pip-install-snwg2_4s/shap_4dbdc5c8e74a45cca2a3aa06af49ba31/setup.py'"'"'; __file__='"'"'/private/var/folders/86/wyxlz8f56nq997hwmvpnt_km0000gn/T/pip-install-snwg2_4s/shap_4dbdc5c8e74a45cca2a3aa06af49ba31/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/86/wyxlz8f56nq997hwmvpnt_km0000gn/T/pip-wheel-nnajc046
       cwd: /private/var/folders/86/wyxlz8f56nq997hwmvpnt_km0000gn/T/pip-install-snwg2_4s/shap_4dbdc5c8e74a45cca2a3aa06af49ba31/
  Complete output (224 lines):
  The nvcc binary could not be located in your $PATH. Either  add it to your path, or set $CUDAHOME to enable CUDA
  Error building cuda module: TypeError('cannot unpack non-iterable NoneType object')
  WARNING: Could not compile cuda extensions
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.14.6-x86_64-3.8
  creating build/lib.macosx-10.14.6-x86_64-3.8/shap
  copying shap/datasets.py -> build/lib.macosx-10.14.6-x86_64-3.8/shap
  copying shap/__init__.py -> build/lib.macosx-10.14.6-x86_64-3.8/shap
  copying shap/links.py -> build/lib.macosx-10.14.6-x86_64-3.8/shap ...

(it is longer than that but I cut it for readability). Also, conda installation gets stuck at executing transaction. As far as I have understood, the problem lies on the fact that Shapiros depends on CUDA. However also after setting CUDA to the path

export CUDA_HOME=/usr/local/cuda-8.0
export LD_LIBRARY_PATH=${CUDA_HOME}/lib64

PATH=${CUDA_HOME}/bin:${PATH}
export PATH

the error remains. I am working on a python virtual environment. I know that anaconda should provide CUDA but anaconda seems to get stuck as well (every command get sucked at "Solving Environment".

How can I solve the issue?

Thank you all.

like image 587
Nutarelli Federico Avatar asked Jan 25 '21 14:01

Nutarelli Federico


Video Answer


1 Answers

Try install python3 dev.

For ubuntu

sudo apt -y install python3-dev

For Centos

sudo yum -y install python3-devel

Edit: If you are using a specific version of python

sudo apt -y install python3.7-dev

Make sure that the dev version and python version are the same

like image 118
nimish Avatar answered Sep 29 '22 10:09

nimish