conda环境内安装gcc4.8.5(无root权限)

  1. 新建conda环境
conda create -n da-faster python=3.6.7 #
conda activate da-faster

2.安装合适的gcc版本,这里我选择的是4.8.5的
anaconda库中选择合适的包,这里我选择的是这个版本
根据下方给出的语句进行安装

conda install -c conda-forge gcc

此时gcc还是默认的版本

gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/opt/ohpc/pub/compiler/gcc/7.3.0/libexec/gcc/x86_64-pc-linux-gnu/7.3.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../configure --disable-multilib --enable-languages=c,c++,fortran --prefix=/opt/ohpc/pub/compiler/gcc/7.3.0 --disable-static --enable-shared
Thread model: posix
gcc version 7.3.0 (GCC) 

我们增加环境变量

 vi ~/.bash_profile

在文件中增加

PATH=/home/yourpath/miniconda/envs/da-faster/bin:$PATH

执行`

source ~/.bash_profile

此时gcc就变为我们安装的版本了

  1. 升级gcc-5
conda install https://anaconda.org/brown-data-science/gcc/5.4.0/download/linux-64/gcc-5.4.0-0.tar.bz2
gcc -v 
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/home/home_node1/pya/miniconda3/envs/regionclip/bin/../libexec/gcc/x86_64-unknown-linux-gnu/5.4.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ./configure --prefix=/home/conda/miniconda2/conda-bld/gcc_1497274051834/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho --with-gxx-include-dir=/home/conda/miniconda2/conda-bld/gcc_1497274051834/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/gcc/include/c++ --enable-checking=release --enable-languages=c,c++,fortran --disable-multilib
Thread model: posix
gcc version 5.4.0 (GCC)

PS:在安装detectron2的时候遇到下面的问题

PIL报下面的错
Error: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found

其实是因为先安装的pillow再降级的gcc,此时只需要重新安装pillow即可

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值