- 新建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就变为我们安装的版本了
- 升级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即可