当前位置:   article > 正文

conda环境内安装gcc4.8.5(无root权限)_conda环境里配置gcc

conda环境里配置gcc
  1. 新建conda环境
conda create -n da-faster python=3.6.7 #
conda activate da-faster
  • 1
  • 2

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

conda install -c conda-forge gcc
  • 1

此时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) 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8

我们增加环境变量

 vi ~/.bash_profile
  • 1

在文件中增加

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

执行`

source ~/.bash_profile
  • 1

此时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
  • 1
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)
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8

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

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

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

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/繁依Fanyi0/article/detail/943073
推荐阅读
相关标签
  

闽ICP备14008679号