【排错教程】解决You're trying to build PyTorch with a too old version of GCC. We need GCC or later.解决没有root权限安装gcc和g++问题

0 问题描述

在使用pip install -e . --no-build-isolation -i https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple安装和编译包时,报You're trying to build PyTorch with a too old version of GCC. We need GCC or later.问题,同时无权限安装GCC和G++

1 解决方案

1.1 激活虚拟环境

conda activate {myenv}

1.2 安装cxx-compiler

在安装前,可以先使用
conda search cxx-compiler -c conda-forge查找自己想要的版本。
然后使用命令conda install -c conda-forge cxx-compiler进行安装。

1.3 修改环境变量

export PATH=/{PATH_TO_YOUR_ENV}/bin/:$PATH
export PATH=/{PATH_TO_YOUR_ENV}/lib/:$PATH

1.4 查看gcc版本

使用gcc -v即可查看版本。

2 参考资料

https://blog.csdn.net/qq_43481884/article/details/135916205

posted @   Lukea  阅读(348)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
· Pantheons:用 TypeScript 打造主流大模型对话的一站式集成库
点击右上角即可分享
微信分享提示