본문 바로가기

programming/python

Python 패키지 폐쇄망 설치

# 외부 통신되는 망 서버가 있을 경우

1. 사용하는 python 버전의 라이브러리 리스트화

$ python -m pip freeze > reuirements.txt

 

2. reuirements.txt 리스트에 있는 패키지를 특정 디렉터리에 다운로드

$ mkdir test && cd test

$ python -m pip download -r requirements.txt

 

3. 생성된 파일과 requirements.txt 파일을 폐쇄망 서버로 이동

 

4. pip 를 통해 오프라인 환경에서 라이브러리 설치

$ python -m pip install --no-index --find-links="./" -r reuirements.txt

 

 

## whl 설치