Running command git submodule update --init --recursive -q Preparing metadata (setup.py)…
- User
Running command git submodule update --init --recursive -q Preparing metadata (setup.py) ... error error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [14 lines of output] Traceback (most recent call last): File "", line 2, in File "", line 34, in File "/tmp/pip-req-build-nqftep5k/setup.py", line 123, in ext_modules=get_extensions() if not BUILD_NO_CUDA else [], File "/tmp/pip-req-build-nqftep5k/setup.py", line 80, in get_extensions extension = CUDAExtension( File "/home/rickard/.local/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 983, in CUDAExtension library_dirs += library_paths(cuda=True) File "/home/rickard/.local/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 1098, in library_paths if (not os.path.exists(_join_cuda_home(lib_dir)) and File "/home/rickard/.local/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 2125, in _join_cuda_home raise EnvironmentError('CUDA_HOME environment variable is not set. ' OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root. [end of output]
note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed
× Encountered error while generating package metadata. ╰─> See above for output.
note: This is an issue with the package mentioned above, not pip. hint: See above for details.
- Assistant
The error message you're encountering indicates that the
setup.pyscript is trying to build a Python package that requires CUDA, but theCUDA_HOMEenvironment variable is not set or incorrect. CUDA (Compute Unified Device Architecture) is a parallel computing platform and application programming interface (API) model created by Nvidia. SettingCUDA_HOMEis necessary for the system to locate where CUDA is installed.To resolve this, you will need to set the environment variable to point to the directory where CUDA is installed. On most Linux-based systems, CUDA is usually installed under . Here's how you can set the environment variable: