Miniconda(Conda) 및 Python 설치

미니콘다(콘다)



아나콘다의 깨끗하고 가벼운 버전.

특징


  • 크로스 플랫폼
  • 파이썬
  • 콘다
  • 미니포지
  • 여러 환경

  • 공식 페이지


  • 미니콘다: https://docs.conda.io/en/latest/miniconda.html
  • Linux에 설치: https://conda.io/projects/conda/en/latest/user-guide/install/linux.html
  • 미니포지: https://github.com/conda-forge/miniforge



  • Linux, macOS 또는 Windows에 설치



    1. Miniconda(v3) 다운로드 및 설치


  • Windows의 경우: https://docs.conda.io/en/latest/miniconda.html
  • Linux 또는 macOS의 경우:

  • ## Recommended path to install Miniconda:
    # For example: ${HOME}/workspaces/runtimes/miniconda3
    
    ## Linux (x86_64):
    wget https://repo.anaconda.com/miniconda/Miniconda3-py38_4.11.0-Linux-x86_64.sh
    bash Miniconda3-py38_4.11.0-Linux-x86_64.sh
    
    ## Linux (aarch64):
    wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-aarch64.sh
    bash Miniforge3-Linux-aarch64.sh
    
    ## macOS (Intel):
    wget https://repo.anaconda.com/miniconda/Miniconda3-py38_4.11.0-MacOSX-x86_64.sh
    bash Miniconda3-py38_4.11.0-MacOSX-x86_64.sh
    
    ## macOS (Apple M1):
    wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-arm64.sh
    bash Miniforge3-MacOSX-arm64.sh
    
    
    # Remove downloaded file:
    rm -vrf Mini*.sh
    
    # For bash:
    # Load .bashrc file to init conda into current bash session:
    source ~/.bashrc
    
    # For zsh:
    # Load .zshrc file to init conda into current zsh session:
    source ~/.zshrc
    
    
    # Clean conda caches:
    conda clean -y -av
    
    # Update conda to the latest version:
    conda update -y conda
    
    # Check installed conda version:
    conda -V
    


    2. 파이썬 설치




    # Create a new conda environment with python and pip:
    conda create -y -n py38 python=3.8.12 pip
    
    # Set default conda environment to .bashrc:
    ## Linux:
    echo "conda activate py38" >> ~/.bashrc
    
    ## macOS:
    echo "conda activate py38" >> ~/.zshrc
    
    # Activate new conda environment:
    conda activate py38
    
    # Upgrade pip to the latest version:
    pip install -U pip
    pip install pytest
    
    # Clean pip caches:
    pip cache purge
    
    # Clean conda caches:
    conda clean -y -av
    
    # Check installed python and pip version:
    python -V
    pip -V
    


    👍 ✨

    설치 완료




    용법




    ## Viewing a list of the packages in a conda environment:
    conda list
    
    # Or list packages of other conda environment:
    conda list -n py38
    
    
    ## Viewing a list of conda environments:
    conda env list
    
    
    ## Creating environment variables associated with Conda environments:
    conda env config vars set PYTHONPATH="${PWD}:${PYTHONPATH}"
    
    
    ## Exporting conda environment to environment.yml file:
    conda env export > environment.yml
    
    
    ## Creating conda environment from environment.yml file:
    conda env create -f environment.yml
    
    
    ## Cloning a conda environment:
    conda create -y -n py38_clone --clone py38
    
    
    ## Removing conda environment:
    conda remove -y -n py38 --all
    
    
    ## Conda help:
    conda -h
    



    참조


  • Miniconda 설치: https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html
  • conda 환경 관리: https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html
  • 좋은 웹페이지 즐겨찾기