Node를 사용하게 되면
package.json이 자동(?)으로 생성되어 사용하는 package를 관리할 수 있다.
(npm등으로 global로 install한게 아니라면 기록된다.)
하지만 python은 자동으로 되지 않는듯 하여, requirements.txt 파일을 생성하여 package를 관리해주어야 하는듯 하다.
1. 현재 install 된 package 확인하기
pip list
주의점은 현재 프로젝트에서 사용되고 있는것만 나오는게 아니라 그냥 전체적으로 install 된 package의 list가 나오므로
필요 없는 package는 없애주는 작업이 필요하다.
2. 설치된 패키지 목록 나열되어 있는 텍스트 파일 만들기
pip freeze > requirements.txt
3. 패키지 한번에 설치하기
pip install -r requirements.txt
4. 버전 관리
- 정확한 버전 관리
six == 1.15.0
- x.x 버전 이상으로 update 하면서 관리
six >= 1.15.0 (1.15.0 version 이상)
자세한 사항은
pip.pypa.io/en/stable/user_guide/
User Guide - pip documentation v21.0.1
python -m pip python -m pip executes pip using the Python interpreter you specified as python. So /usr/bin/python3.7 -m pip means you are executing pip for your interpreter located at /usr/bin/python3.7. py -m pip py -m pip executes pip using the latest Py
pip.pypa.io
pipenv.pypa.io/en/latest/advanced/#generating-a-requirements-txt
Advanced Usage of Pipenv — pipenv 2020.11.16.dev0 documentation
Advanced Usage of Pipenv This document covers some of Pipenv’s more glorious and advanced features. ☤ Caveats Dependencies of wheels provided in a Pipfile will not be captured by $ pipenv lock. There are some known issues with using private indexes, re
pipenv.pypa.io
참고
파이썬 패키지에 requirements.txt 추가 및 dependency 해결해 주기
일단 들어가기 앞서 깃허브 주소를 수정 가능하다는 걸 깨닫고, PyPI 도 ypcc, git주소도 ypcc로 통일.(20190214)
onlytojay.medium.com
[Python] requirements.txt로 패키지 관리하기
파이썬으로 프로젝트를 진행하게되면 pip으로 여러 패키지를 설치하게된다.pip list를 입력하면 다음과 같이 pip으로 설치된 모든 패키지가 나온다.참고로 inda==2.8 같은 경우, idna라는 패키지를 정
velog.io
docs.aws.amazon.com/ko_kr/elasticbeanstalk/latest/dg/python-configuration-requirements.html
요구 사항 파일을 사용하여 종속 항목 지정 - AWS Elastic Beanstalk
요구 사항 파일을 사용하여 종속 항목 지정 일반적인 Python 애플리케이션은 타사의 Python 패키지에 대한 종속 항목을 가지고 있습니다. Elastic Beanstalk Python 플랫폼에서는 애플리케이션이 의존하는
docs.aws.amazon.com
'Python' 카테고리의 다른 글
[PYTHON] 서버·개발 환경을 위한 config 분리하기 (0) | 2021.04.19 |
---|---|
[Python] Script 작성 (0) | 2021.04.15 |
[python] REST API 호출 (requests 이용) (0) | 2021.04.07 |
[Python] 날짜 구하기 (날짜 리스트 만들기) (0) | 2021.04.07 |
[PYTHON] TXT 파일 생성 / 수정 / 읽기 (한글깨짐) (0) | 2021.04.07 |