# 报错信息:
In file included from src/cpp/cuda.cpp:4:
src/cpp/cuda.hpp:14:10: fatal error: cuda.h: No such file or directory
14 | #include <cuda.h>
| ^~~~~~~~
compilation terminated.
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pycuda
Failed to build pycuda
ERROR: Could not build wheels for pycuda, which is required to install pyproject.toml-based projects
# 在编译安装的时候主要是找不到库文件导致的
#解决方式
step1:打开.bashrc文件
vim ~/.bashrc
step2:.bashrc文件中在添加如下环境变量
export PATH=/usr/local/cuda-11.4/bin:/usr/local/cuda/bin:$PATH
step3:让环境变量生效
source ~/.bashrc
step4:重新安装pycuda
pip3 install pycuda