pycuda 安装时出现以下问题:
ERROR: Command errored out with exit status 1:
command: /home/ed/anaconda3/envs/cam/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-c_yustsl/pycuda/setup.py'"'"'; __file__='"'"'/tmp/pip-install-c_yustsl/pycuda/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 /tmp/pip-wheel-wpyh3swb
cwd: /tmp/pip-install-c_yustsl/pycuda/
Complete output (104 lines):
***************************************************************
*** WARNING: nvcc not in path.
*** May need to set CUDA_INC_DIR for installation to succeed.
***************************************************************
解决方法:
在~/.bashrc文件中增加:
export CUDA_ROOT=/usr/local/cuda
export PATH=$PATH:$CUDA_ROOT/bin
然后 千万别忘记了要执行命令:source ~/.bashrc,或者重新开一个终端。
然后再用pip install pycuda命令,成功!