CentOS 8에 Anaconda 설치 방법

CentOS 8에 Anaconda 설치 방법

2022-05-17 last update

8 minutes reading anaconda centos
Anaconda는 가장 유행하는 Python/R 데이터 과학과 기계 학습 플랫폼이다.그것은 대규모 데이터 처리, 예측 분석, 과학 계산에 쓰인다.Anaconda distribution에는 1500개 이상의 소스 패킷이 포함되어 있습니다.명령줄 도구conda와 Anaconda Navigator라는 데스크톱 그래픽 사용자 인터페이스도 포함됩니다.이 자습서에서는 CentOS 8에 Anaconda Python 릴리스를 설치하는 방법에 대해 설명합니다.

구렁이를 설치하다

본문을 작성할 때 아나콘다의 최신 안정적인 버전은 2019.10 버전이다.Anaconda 설치 프로그램 스크립트를 다운로드하기 전에 Anaconda Downloads page를 방문하십시오.
Python 3의 새 버전인 Anaconda를 다운로드할 수 있는지 확인합니다. CentOS 8에 Anaconda를 설치하려면 다음 단계를 완료하십시오.
  • 다운로드 페이지에서 복사한 링크를 사용하여 Anaconda 설치 스크립트를 다운로드합니다.
    wget -P /tmp https://repo.anaconda.com/archive/Anaconda3-2019.10-Linux-x86_64.sh
    다운로드하려면 접속 속도에 따라 시간이 좀 걸릴 수 있습니다.데스크탑에 Anaconda를 설치하려면 web browser를 사용하여 스크립트를 다운로드할 수 있습니다.
  • 명령을 사용하여 스크립트의 데이터 완전성을 검증한다.
    sha256sum Anaconda3-5.3.1-Linux-x86_64.sh
    출력은 다음과 같다.
    46d762284d252e51cd58a8ca6c8adc9da2eadc82c342927b2f66ed011d1d8b53  /tmp/Anaconda3-2019.10-Linux-x86_64.sh
    상기 명령에서 인쇄한 하시가 Anaconda with Python 3 on 64-bit Linux page에서 사용할 수 있는 하시와 일치하도록 확보한다.
    너에게 어울리는 구렁이 버전.
  • 는 설치 스크립트를 실행하여 Anaconda 설치 과정을 시작합니다.
    bash Anaconda3-2019.10-Linux-x86_64.sh
    다음과 같은 출력을 보실 수 있습니다.
    Welcome to Anaconda3 2019.10
    
    In order to continue the installation process, please review the license
    agreement.
    Please, press ENTER to continue
    >>> 
    
    누르기sha256sum를 누르면 계속하고 ENTER를 누르면 라이센스를 스크롤할 수 있습니다.라이센스 약관의 승인을 요청할 수 있습니다.
    Do you accept the license terms? [yes|no]
    [no] >>> yes
    라이센스를 받으려면 ENTER를 입력하십시오. 설치 프로그램은 설치 위치를 선택하도록 요구합니다.
    Anaconda3 will now be installed into this location:
    /home//anaconda3
    
    - Press ENTER to confirm the location
    - Press CTRL-C to abort the installation
    - Or specify a different location below
    기본 위치는 대부분의 사용자에게 적합합니다.yes를 눌러 위치를 확인하고 설치 프로세스를 계속합니다.ENTER 오류가 발생하면 bunzip2: command not found 패키지를 설치하고 설치 스크립트를 다시 실행하십시오. 설치를 완료하는 데 시간이 좀 걸릴 수 있습니다.완료하면 다음과 같은 출력을 볼 수 있습니다:
    Preparing transaction: done
    Executing transaction: done
    installation finished.
    Do you wish the installer to initialize Anaconda3
    by running conda init? [yes|no]
    
    입력bzip2, 누르기sudo dnf install bzip2, 스크립트는 yes 에 추가ENTER:
    ==> For changes to take effect, close and re-open your current shell. <==
    
    If you'd prefer that conda's base environment not be activated on startup, 
    set the auto_activate_base parameter to false: 
    
    conda config --set auto_activate_base false
    
    Thank you for installing Anaconda3!
    
    ...
    
    Anaconda 설치를 활성화하려면 셸을 닫고 다시 열거나:
    source ~/.bashrc
  • 를 입력하여 새 conda 환경 변수를 현재 셸 세션에 불러올 수 있습니다. PATH 명령을 사용하여 Anaconda 설치를 검증합니다.다음 명령은 설치에 대한 정보를 표시합니다:
    conda info
        active environment : base
        active env location : /home/vagrant/anaconda3
                shell level : 1
        user config file : /home/vagrant/.condarc
    populated config files : 
            conda version : 4.7.12
        conda-build version : 3.18.9
            python version : 3.7.4.final.0
        ...
  • 구렁이를 갱신하다

    구렁이를 업데이트하는 것은 매우 간단한 과정입니다. 먼저
    conda update conda
    구렁이 도구를 업데이트합니다. 업데이트를 확인하는 메시지가 나타날 때 PATH를 입력하여 계속합니다.conda가 업데이트되면 Anaconda 업데이트를 계속 실행합니다.
    conda update anaconda
    이전 명령과 같고, 알림이 나타날 때 conda 를 입력하여 계속합니다.Anaconda 설치를 정기적으로 업데이트하는 것을 잊지 마세요.

    구렁이를 부리다

    CentOS 시스템에서 Anaconda를 제거하려면 먼저remove
    Anaconda 설치 디렉토리:
    rm -rf ~/anaconda3
    파일을 편집하고 PATH 환경 변수에서 Anaconda 디렉토리를 제거합니다. ~/bashrc
    # >>> conda initialize >>>
    # !! Contents within this block are managed by 'conda init' !!
    __conda_setup="$('/home//anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
    if [ $? -eq 0 ]; then
        eval "$__conda_setup"
    else
        if [ -f "/home//anaconda3/etc/profile.d/conda.sh" ]; then
            . "/home//anaconda3/etc/profile.d/conda.sh"
        else
            export PATH="/home//anaconda3/bin:$PATH"
        fi
    fi
    unset __conda_setup
    # <<< conda initialize <<<
    
    에서 다음 명령을 실행 y
    사용자 홈 디렉터리에서 숨겨진 파일과 폴더를 삭제하는 명령:
    rm -rf ~/.condarc ~/.conda ~/.continuum

    결론

    현재 Anaconda를 다운로드하고 설치했습니다. 공식Getting started with conda을 볼 수 있습니다.
    가이드만약 문제가 있거나 피드백이 있다면 아래에 메시지를 남겨 주십시오.