Ubuntu安装pycuda报错:required to install pyproject.toml-based projects

最近使用ubuntu安装pycuda时报错

subset/bpl_subset/libs/python/src/converter/arg_to_python_base.o
      <command-line>: fatal error: /usr/local/cuda/include/stdc-predef.h: 权限不够
      compilation terminated.
      error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
      [end of output]
  
  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

一直在找最后一条的错误信息,忽略了前面那句权限不够。

cd到/usr/local/cuda目录下

使用ls命令
查看权限发现include颜色和其他的不同,是蓝绿色的,没有权限

使用sudo chmod 777 include赋权限

cd /usr/local/cuda-11.7/
ls
sudo chmod 777 include

继续pip install pycuda ,运行成功

pip install pycuda


Defaulting to user installation because normal site-packages is not writeable
Collecting pycuda
  Using cached pycuda-2023.1.tar.gz (1.7 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting pytools>=2011.2 (from pycuda)
  Using cached pytools-2023.1.1-py2.py3-none-any.whl.metadata (2.7 kB)
Collecting appdirs>=1.4.0 (from pycuda)
  Using cached appdirs-1.4.4-py2.py3-none-any.whl (9.6 kB)
Collecting mako (from pycuda)
  Using cached Mako-1.3.0-py3-none-any.whl.metadata (2.9 kB)
Collecting platformdirs>=2.2.0 (from pytools>=2011.2->pycuda)
  Using cached platformdirs-4.0.0-py3-none-any.whl.metadata (11 kB)
Requirement already satisfied: typing-extensions>=4.0 in ./.local/lib/python3.10/site-packages (from pytools>=2011.2->pycuda) (4.8.0)
Requirement already satisfied: MarkupSafe>=0.9.2 in ./.local/lib/python3.10/site-packages (from mako->pycuda) (2.1.3)
Using cached pytools-2023.1.1-py2.py3-none-any.whl (70 kB)
Using cached Mako-1.3.0-py3-none-any.whl (78 kB)
Using cached platformdirs-4.0.0-py3-none-any.whl (17 kB)
Building wheels for collected packages: pycuda
  Building wheel for pycuda (pyproject.toml) ... done
  Created wheel for pycuda: filename=pycuda-2023.1-cp310-cp310-linux_x86_64.whl size=661263 sha256=8d250013fb662277fe30d7e3a88dfeb9838420974e524b1ad1f504cbad360935
  Stored in directory: /home/lww/.cache/pip/wheels/46/65/06/b997165edd2fd9690c3497ca54ea4485b571d7bd959c21c6c4
Successfully built pycuda
Installing collected packages: appdirs, platformdirs, mako, pytools, pycuda
Successfully installed appdirs-1.4.4 mako-1.3.0 platformdirs-4.0.0 pycuda-2023.1 pytools-2023.1.1

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值