본문 바로가기
Python 연습/1. Python 설치와 실습 - 아나콘다

Q_01_28. Conda 콘다 명령문 사용하기

by Python통컨 2025. 3. 20.

아나콘다 프롬프트에 들어오면 conda 패키지 관리자를 사용할 수 있게 됩니다. 사용방법은 conda –n [가상공간이름] [패키지이름] 으로 사용합니다. pip install ... 명령어와 사용방법이 비슷합니다.

conda 명령문 리스트 살펴보기

(base) C:\Users\USER > conda

usage: conda-script.py [-h] [--no-plugins] [-V] COMMAND ...

conda is a tool for managing and deploying applications, environments and packages.

options:
  -h, --help          Show this help message and exit.
  --no-plugins        Disable all plugins that are not built into conda.
  -V, --version       Show the conda version number and exit.

commands:
  The following built-in and plugins subcommands are available.

  COMMAND
    build             Build conda packages from a conda recipe.
    clean             Remove unused packages and caches.
    compare           Compare packages between conda environments.
    config            Modify configuration values in .condarc.
    content-trust     Signing and verification tools for Conda
    convert           Convert pure Python packages to other platforms (a.k.a., subdirs).
    create            Create a new conda environment from a list of specified packages.
    debug             Debug the build or test phases of conda recipes.
    develop           Install a Python package in 'development mode'. Similar to `pip install --editable`.
    doctor            Display a health report for your environment.
    env               See `conda env --help`.
    index             Update package index metadata files. Pending deprecation, use https://github.com/conda/conda-
                      index instead.
    info              Display information about current conda install.
    init              Initialize conda for shell interaction.
    inspect           Tools for inspecting conda packages.
    install           Install a list of packages into a specified conda environment.
    list              List installed packages in a conda environment.
    metapackage       Specialty tool for generating conda metapackage.
    notices           Retrieve latest channel notifications.
    pack              See `conda pack --help`.
    package           Create low-level conda packages. (EXPERIMENTAL)
    remove (uninstall)
                      Remove a list of packages from a specified conda environment.
    rename            Rename an existing environment.
    render            Expand a conda recipe into a platform-specific recipe.
    repo              See `conda repo --help`.
    run               Run an executable in a conda environment.
    search            Search for packages and display associated information using the MatchSpec format.
    server            See `conda server --help`.
    skeleton          Generate boilerplate conda recipes.
    token             See `conda token --help`.
    update (upgrade)  Update conda packages to the latest compatible version.
    verify            See `conda verify --help`.  
(base) C:\Users\USER>
 > conda --version     아나콘다 버전 확인
 > conda clean         설치된 패키지 모두 삭게
 > conda create        가상환경 만들기
 > conda info          아나콘다 정보 조회 
 > conda install       패키지 설치
 > conda list          패키지 리스트 조회
 > conda install 패키지명
 > conda remove        패키지 삭제
 > conda search        패키지 조회
 > conda uninstall     Alias for conda 삭제
 > conda update        최신 버전으로 업데이트
 > conda upgrage       Alias for conda 업데이트

사용예
(base) C:\Users\USER>conda list

 

> conda info # 아나콘다 정보 조회

> conda install sas7bdat # sas파일을 읽기 위해 sas7bdat 패키지 설치
>>> import sas7bdat # ... 이제 되는구나...

(base) C:\Users\USER>conda —version   
     conda 4.8.3
(base) C:\Users\USER> conda update conda    
     conda: 4.3.8-py36_0 -> 4.3.13-py36_0  –n base conda
(base) C:\Users\USER> conda —version   
conda 4.8.5

(base) C:\Users\USER> conda install keras   
(base) C:\Users\USER> conda install jupyter   

(base) C:\Users\USER> conda update  --all  # 설치된 패키지 모두 최신 것으로   
(base) C:\Users\USER> conda update tensorflow     

(base) C:\Users\USER>pip   
(base) C:\Users\USER>pip —help   
(base) C:\Users\USER>pip —version      
pip 20.1.1 
from d:\anaconda3\lib\site-packages\pip (python 3.8)      
(base) C:\Users\USER>conda upgrade pip