700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > pycuda installation error: command 'gcc' failed with exit status 1

pycuda installation error: command 'gcc' failed with exit status 1

时间:2019-11-13 19:36:10

相关推荐

pycuda installation error: command 'gcc' failed with exit status 1

原文:python采坑之路

Setup script exited with error: command 'gcc' failed with exit status 1

伴随出现“cuda.h” cannot be find

由于没有正确安装Python开发环境导致。

Debin/Ubuntu

Python2

sudo apt-get install python-dev

Python3

sudo apt-get install python3-dev

可能需要libevent库

sudo apt-get install libevent-dev

最后更新下开发环境

sudo apt-get groupinstall 'development tools'

Centos/Fedora

sudo yum install python-devel

sudo yum install libevent-devel

easy_install gevent

或者

pip install gevent

把环境更新下

sudo yum install groupinstall 'development tools'

注意事项:

sudo apt-get groupinstall 'development tools'

不能使用

出错的地方在于没有添加cuda path,因此添加CUDApath

sudo get edit ~./bashrc

添加

export PATH=/usr/local/cuda/bin:$PATH

export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH

export CUDA_ROOT=/usr/local/cuda

此后Pycuda安装成功。

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。