1. pip 이란?
- pip은 파이썬 패키지를 설치 및 관리하는 패키지 관리자를 말함
- Pip installs Package의 약자
2. pip 패키지 설치와 제거
- pip install : 패키지 설치
pip install 패키지명
ex)
$ pip install sklearn
$ pip install tqdm
$ pip install numpy
- pip uninstall : 설치된 패키지 제거
pip uninstall 패키지명
ex)
$ pip uninstall numpy
- pip list : 현재 pip으로 설치된 패키지들의 리스트 확인
$ pip list
sklearn 0.0
soupsieve 2.3.1
stack-data 0.2.0
terminado 0.13.1
testpath 0.6.0
threadpoolctl 3.1.0
tokenizers 0.10.3
torch 1.12.0+cu116
torch-optimizer 0.3.0
torchaudio 0.12.0+cu116
torchtext 0.6.0
torchvision 0.13.0+cu116
tornado 6.1
tqdm 4.64.0
traitlets 5.1.1
transformers 4.10.0
typing_extensions 4.3.0
urllib3 1.26.10
wcwidth 0.2.5
webencodings 0.5.1
wheel 0.37.1
widgetsnbextension 3.6.1
wincertstore 0.2
- --upgrade 옵션 : 설치된 패키지를 최신 버전으로 업그레이드
ex)
$ pip install numpy --upgrade
3. pip: requirements 파일 생성 및 사용
pip을 사용해 패키지 그룹을 묶어서 설치하거나 현재 설치된 패키지들을 그룹화 해서 requirements.txt로 저장,
가상환경의 패키지를 관리할 때도 유용하게 쓰임
- requirements.txt 파일 생성
$ pip freeze > requirements.txt
- 생성한 requirements.txt 파일을 사용한 패키지 리스트 설치
$ pip install -r requirements.txt
4. pip 버전 업그레이드
$ pip install --upgrade pip
반응형
'AI > Python Module' 카테고리의 다른 글
Numpy (0) | 2022.05.25 |
---|---|
Pandas #Series #DataFrame #인덱스 활용 (0) | 2021.11.29 |
Python #eunjeon, mecab 모듈 설치 (0) | 2021.10.21 |
Python #KoNLPy (0) | 2021.10.19 |
PyAutoGUI #파이썬 마우스 키보드 이벤트 제어 (0) | 2021.10.17 |