Reputation: 21
ERROR: Could not build wheels for cupy, which is required to install pyproject.toml-based projects
$ pip install cupy
Collecting cupy
Using cached cupy-12.0.0.tar.gz (2.0 MB)
Preparing metadata (setup.py) ... done
Requirement already satisfied: numpy<1.27,>=1.20 in c:\users\eva02\anaconda3\envs\sklearn\lib\site-packages (from cupy) (1.20.0)Requirement already satisfied: fastrlock>=0.5 in c:\users\eva02\anaconda3\envs\sklearn\lib\site-packages (from cupy) (0.8.1)
Building wheels for collected packages: cupy
Building wheel for cupy (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [55 lines of output]
Clearing directory: C:\Users\eva02\AppData\Local\Temp\pip-install-iyqad32h\cupy_721ae8a0802c4c878ac1db5b83119067\cupy\.data
Looking for NVTX: C:\Program Files\NVIDIA Corporation\Nsight Systems *\target-windows-x64\nvtx
Using NVTX at: C:\Program Files\NVIDIA Corporation\Nsight Systems 2022.4.2\target-windows-x64\nvtx
-------- Configuring Module: cuda --------
Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
**************************************************
*** WARNING: Cannot check compute capability
Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
**************************************************
************************************************************
* CuPy Configuration Summary *
************************************************************
Build Environment:
Include directories: ['C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.0\\include\\cub', 'C:\\Users\\eva02\\AppData\\Local\\Temp\\pip-install-iyqad32h\\cupy_721ae8a0802c4c878ac1db5b83119067\\cupy/_core/include', 'C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.0\\include', 'C:\\Program Files\\NVIDIA Corporation\\Nsight Systems 2022.4.2\\target-windows-x64\\nvtx\\include']
Library directories: ['C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.0\\bin', 'C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.0\\lib\\x64']
nvcc command : ['C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.0\\bin/nvcc.exe']
hipcc command : (not found)
Environment Variables:
CFLAGS : (none)
LDFLAGS : (none)
LIBRARY_PATH : (none)
CUDA_PATH : C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.0
NVCC : (none)
HIPCC : (none)
ROCM_HOME : (none)
Modules:
cuda : No
-> Include files not found: ['cublas_v2.h', 'cuda.h', 'cuda_profiler_api.h', 'cuda_runtime.h', 'cufft.h', 'curand.h', 'cusparse.h', 'nvrtc.h']
-> Check your CFLAGS environment variable.
ERROR: CUDA could not be found on your system.
HINT: You are trying to build CuPy from source, which is NOT recommended for general use.
Please consider using binary packages instead.
Please refer to the Installation Guide for details:
https://docs.cupy.dev/en/stable/install.html
************************************************************
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "C:\Users\eva02\AppData\Local\Temp\pip-install-iyqad32h\cupy_721ae8a0802c4c878ac1db5b83119067\setup.py", line 88, in <module>
ext_modules = cupy_setup_build.get_ext_modules(True, ctx)
File "C:\Users\eva02\AppData\Local\Temp\pip-install-iyqad32h\cupy_721ae8a0802c4c878ac1db5b83119067\install\cupy_builder\cupy_setup_build.py", line 449, in get_ext_modules
extensions = make_extensions(ctx, compiler, use_cython)
File "C:\Users\eva02\AppData\Local\Temp\pip-install-iyqad32h\cupy_721ae8a0802c4c878ac1db5b83119067\install\cupy_builder\cupy_setup_build.py", line 305, in make_extensions
raise Exception('Your CUDA environment is invalid. '
Exception: Your CUDA environment is invalid. Please check above error log.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for cupy
Running setup.py clean for cupy
error: subprocess-exited-with-error
× python setup.py clean did not run successfully.
│ exit code: 1
╰─> [55 lines of output]
Clearing directory: C:\Users\eva02\AppData\Local\Temp\pip-install-iyqad32h\cupy_721ae8a0802c4c878ac1db5b83119067\cupy\.data
Looking for NVTX: C:\Program Files\NVIDIA Corporation\Nsight Systems *\target-windows-x64\nvtx
Using NVTX at: C:\Program Files\NVIDIA Corporation\Nsight Systems 2022.4.2\target-windows-x64\nvtx
-------- Configuring Module: cuda --------
Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
**************************************************
*** WARNING: Cannot check compute capability
Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
**************************************************
************************************************************
* CuPy Configuration Summary *
************************************************************
Build Environment:
Include directories: ['C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.0\\include\\cub', 'C:\\Users\\eva02\\AppData\\Local\\Temp\\pip-install-iyqad32h\\cupy_721ae8a0802c4c878ac1db5b83119067\\cupy/_core/include', 'C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.0\\include', 'C:\\Program Files\\NVIDIA Corporation\\Nsight Systems 2022.4.2\\target-windows-x64\\nvtx\\include']
Library directories: ['C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.0\\bin', 'C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.0\\lib\\x64']
nvcc command : ['C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.0\\bin/nvcc.exe']
hipcc command : (not found)
Environment Variables:
CFLAGS : (none)
LDFLAGS : (none)
LIBRARY_PATH : (none)
CUDA_PATH : C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.0
NVCC : (none)
HIPCC : (none)
ROCM_HOME : (none)
Modules:
cuda : No
-> Include files not found: ['cublas_v2.h', 'cuda.h', 'cuda_profiler_api.h', 'cuda_runtime.h', 'cufft.h', 'curand.h', 'cusparse.h', 'nvrtc.h']
-> Check your CFLAGS environment variable.
ERROR: CUDA could not be found on your system.
HINT: You are trying to build CuPy from source, which is NOT recommended for general use.
Please consider using binary packages instead.
Please refer to the Installation Guide for details:
https://docs.cupy.dev/en/stable/install.html
************************************************************
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "C:\Users\eva02\AppData\Local\Temp\pip-install-iyqad32h\cupy_721ae8a0802c4c878ac1db5b83119067\setup.py", line 88, in <module>
ext_modules = cupy_setup_build.get_ext_modules(True, ctx)
File "C:\Users\eva02\AppData\Local\Temp\pip-install-iyqad32h\cupy_721ae8a0802c4c878ac1db5b83119067\install\cupy_builder\cupy_setup_build.py", line 449, in get_ext_modules
extensions = make_extensions(ctx, compiler, use_cython)
File "C:\Users\eva02\AppData\Local\Temp\pip-install-iyqad32h\cupy_721ae8a0802c4c878ac1db5b83119067\install\cupy_builder\cupy_setup_build.py", line 305, in make_extensions
raise Exception('Your CUDA environment is invalid. '
Exception: Your CUDA environment is invalid. Please check above error log.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed cleaning build dir for cupy
Failed to build cupy
ERROR: Could not build wheels for cupy, which is required to install pyproject.toml-based projects
I tried pip install install pyproject.toml-based projects
, but it did not work.
Upvotes: 2
Views: 6320
Reputation: 11
Yes, find the CUDA version with nvcc --version
and run pip install cupy-cuda{major_version}x
.
Source: https://docs.cupy.dev/en/stable/install.html
Upvotes: 0
Reputation: 9
I had the same error and my cuda version is 11.3.
I solved it on my server using
pip install cupy-cuda11x
You can use the following command to check your cuda version
nvcc --version
Hope it works for you. :)
Reference: https://docs.cupy.dev/en/stable/install.html#installing-cupy
Upvotes: 0