본문 바로가기
대동단결 Python

모듈 일괄 설치

by 즐거운 지니 2023. 12. 19.
반응형

다음은 PIP와 함께 사용하는 명령어 이다.

Commands:  
  install                     Install packages.  
  download                    Download packages.  
  uninstall                   Uninstall packages.  
  freeze                      Output installed packages in requirements format.  
  inspect                     Inspect the python environment.  
  list                        List installed packages.  
  show                        Show information about installed packages.  
  check                       Verify installed packages have compatible dependencies.  
  config                      Manage local and global configuration.  
  search                      Search PyPI for packages.  
  cache                       Inspect and manage pip's wheel cache.  
  index                       Inspect information available from package indexes.  
  wheel                       Build wheels from your requirements.  
  hash                        Compute hashes of package archives.  
  completion                  A helper command used for command completion.  
  debug                       Show information useful for debugging.  
  help                        Show help for commands.

어떤 모듈을 설치할 때는

pip install 모듈명

반대로 제거 할 때는

pip uninstall 모듈명

하면 된다.

설치해야 할 모듈들의 목록을 기록한 requirments.txt 라는 파일이 있다고 하면 그 목록대로 일괄 설치할 수 있다.

pip install -r requirments.txt

requirments.txt를 쉽게 만들 수 있는 방법으로 현재 사용중인 파이선 환경에 설치된 모듈들의 목록을 다음과 같이 만들 수 있다.

pip freeze > requirments.txt

가상환경에서 매우 유용하다.

반응형

댓글