Ubuntu 20.04에 Anaconda를 설치하는 방법

Ubuntu 20.04에 Anaconda를 설치하는 방법

2022-05-16 last update

8 minutes reading anaconda ubuntu
Anaconda는 대규모 데이터 처리, 예측 분석 및 과학 컴퓨팅에 사용되는 인기 있는 Python/R 데이터 과학 및 기계 학습 플랫폼입니다. Anaconda 배포판은 250개의 오픈 소스 데이터 패키지와 함께 제공되며 Anaconda 저장소에서 7,500개 이상의 추가 패키지를 설치할 수 있습니다. 여기에는 conda 명령줄 도구와 Anaconda Navigator라는 데스크톱 그래픽 사용자 인터페이스도 포함되어 있습니다. 이 자습서에서는 Ubuntu 20.04에 Anaconda Python 배포를 설치하는 과정을 안내합니다. Anaconda 설치 이 기사를 작성할 당시 최신 안정 Anaconda의 버전은 2020.02 버전입니다. 설치 프로그램 스크립트를 다운로드하기 전에 Downloads page
다운로드할 수 있는 Python 3용 Anaconda의 새 버전이 있는지 확인합니다. Ubuntu 20.04에 Anaconda를 설치하려면 다음 단계를 완료하십시오.
  • Anaconda Navigator는 QT 기반 GUI입니다. 데스크탑 시스템에 Anaconda를 설치하고 GUI 애플리케이션을 사용하려면 다음 패키지를 설치하십시오. 그렇지 않으면 이 단계를 건너뜁니다.
    sudo apt install libgl1-mesa-glx libegl1-mesa libxrandr2 libxrandr2 libxss1 libxcursor1 libxcomposite1 libasound2 libxi6 libxtst6
  • web browser와 함께 Anaconda 설치 스크립트를 다운로드하십시오.
    또는 wget
    :
    wget -P /tmp https://repo.anaconda.com/archive/Anaconda3-2020.02-Linux-x86_64.sh
    접속 속도에 따라 다운로드 시간이 다소 소요될 수 있습니다.
  • 이 단계는 선택 사항이지만 스크립트의 데이터 무결성을 확인하는 것이 좋습니다. sha256sum 명령을 사용하여 스크립트 체크섬을 표시합니다.
    sha256sum /tmp/Anaconda3-2020.02-Linux-x86_64.sh
    출력은 다음과 같아야 합니다.
    2b9f088b2022edb474915d9f69a803d6449d5fdb4c303041f60ac4aefcc208bb  /tmp/Anaconda3-2020.02-Linux-x86_64.sh
    확인 위의 명령에서 인쇄된 해시가 Anaconda with Python 3 on 64-bit Linux page에서 사용 가능한 해시와 일치하는지 확인하십시오.
    적절한 Anaconda 버전에 대해.
    https://docs.anaconda.com/anaconda/install/hashes/Anaconda3-2020.02-Linux-x86_64.sh-hash/
  • 스크립트를 실행하여 설치 프로세스를 시작하십시오.
    bash /tmp/Anaconda3-2020.02-Linux-x86_64.sh
    다음과 같은 출력이 표시되어야 합니다.
    Welcome to Anaconda3 2020.02
    
    In order to continue the installation process, please review the license
    agreement.
    Please, press ENTER to continue
    >>> 
    계속하려면 ENTER를 누르십시오. 라이센스를 스크롤하려면 ENTER 키를 사용하십시오. 라이선스 검토를 마치면 라이선스 조건을 승인하라는 메시지가 표시됩니다.
    Do you approve the license terms? [yes|no]
    yes를 입력하여 라이선스에 동의하면 설치 위치를 선택하라는 메시지가 표시됩니다.
    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
    기본 위치 대부분의 사용자에게 적합합니다. ENTER를 눌러 위치를 확인합니다. 설치에는 시간이 걸릴 수 있으며 완료되면 스크립트에서 실행할지 묻는 메시지가 표시됩니다conda init. 유형yes .
    Installation finished.
    Do you wish the installer to initialize Anaconda3
    by running conda init? [yes|no]
    이렇게 하면 명령줄 도구conda가 시스템 PATH 에 추가됩니다.
    .Anaconda 설치를 활성화하려면 셸을 닫았다가 다시 열거나 다음을 입력하여 새PATH 환경 변수를 현재 셸 세션에 로드할 수 있습니다.
    source ~/.bashrc
    터미널에서 설치 유형conda을 확인하려면.
  • 그게 다야! Ubuntu 시스템에 Anaconda를 성공적으로 설치했으며 사용할 수 있습니다. 데스크탑 시스템에 Anaconda를 설치했다면 터미널에 anaconda-navigator를 입력하여 Navigator GUI를 엽니다. Anaconda 업데이트 Anaconda 업데이트는 매우 간단한 과정입니다. 터미널을 열고 다음을 입력합니다.
    conda update --all
    업데이트가 있는 경우 conda 목록이 표시되고 업데이트를 확인하라는 메시지가 표시됩니다.
    The following packages will be UPDATED:
    
      anaconda-navigator                          1.9.12-py37_0 --> 1.9.12-py37_1
      conda                                        4.8.2-py37_0 --> 4.8.3-py37_0
      conda-package-han~                   1.6.0-py37h7b6447c_0 --> 1.6.1-py37h7b6447c_0
    
    
    Proceed ([y]/n)? 
    
    Anaconda 설치를 정기적으로 업데이트하는 것이 좋습니다. Anaconda 제거 Ubuntu 시스템에서 Anaconda를 제거합니다. remove
    Anaconda 설치 디렉토리 및 설치 중에 생성된 다른 모든 파일:
    rm -rf ~/anaconda3 ~/.condarc ~/.conda ~/.continuum
    열기 ~/.bashrc
    파일을 열고 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 <<<
    결론 Ubuntu 20.04에 Anaconda를 설치하는 방법을 보여 주었습니다. 이제 공식Getting started with conda을 확인해야 합니다.
    가이드. 문제가 발생하거나 피드백이 있으면 아래에 의견을 남겨주세요.