다운로드 한 PIP 패키지를 캐시하는 방법
이 질문에 이미 답변이 있습니다.
- pip를 사용하여 로컬 캐시에서 어떻게 설치합니까? 10 개의 답변
PIP가 이전에 다운로드 한 패키지를 다시 다운로드하는 것을 어떻게 방지합니까? 여러 배포 판별 패키지에 의존하는 11MB 패키지 인 matplotlib의 설치를 테스트하고 있습니다. 를 실행할 pip install matplotlib
때 마다 matplotlib를 다시 다운로드합니다. 어떻게 멈출 수 있습니까?
특정 환경 변수 PIP_DOWNLOAD_CACHE 를 사용하여 패키지가 저장 될 디렉토리를 가리킬 수 있습니다. 다시 설치하려면이 디렉토리에서 가져옵니다.
pip --download-cache
비슷한 작업을해야하는 PIP에 대한 추가 옵션도있는 것 같지만 직접 시도한 적이 없습니다. 예를 들어 matplotlib
매번 다시 다운로드 하지 않으려면 다음을 수행하십시오.
pip install --download-cache /path/to/pip/cache matplotlib
질문에 대한 답이 되었습니까?
새로운 Pip 버전 :
기본적으로 최신 Pip 버전은 이제 다운로드를 캐시합니다. 이 문서를 참조하십시오.
https://pip.pypa.io/en/stable/reference/pip_install/#caching
이전 Pip 버전의 경우 :
라는 구성 파일 ~/.pip/pip.conf
을 만들고 다음 내용을 추가합니다.
[global]
download_cache = ~/.cache/pip
하나의 명령으로 :
printf '[global]\ndownload_cache = ~/.cache/pip\n' >> ~/.pip/pip.conf
당신은 할 수 있습니다
# download and extract package to build path
pip install --no-install matplotlib
# the build path could be found by
pip install --help|grep Unpack\ packages\ into -A 2
# then rm pip-delete-this-directory.txt inside the build path
# this prevent pip from removing package from the build directory after install
# you could check the content of the file
rm build/pip-delete-this-directory.txt
# from now on you could install matplotlib quickly
# this uses single build directory
# and can speed up compiling by caching intermediate objects.
pip install --no-download matplotlib
또한 패키지를 수동으로 다운로드 할 수 있습니다.
pip install -d dir_for_packages matplotlib
그런 다음 un-tar 및 python setup install
나중에 설치하십시오 .
pip install --download-cache
유사한 방식으로 작동 승 / 추가 검사 : 검색이 지정한 디렉토리에 패키지를 결과를 가지고 있으며,이 캐시되는 경우는 첫째, 웹에서 대상 패키지의 최신 또는 지정된 버전을 검색 download-cache
, 캐시 된 패키지가 대신 사용됩니다 다운로드 예를 들면
pip install --download-cache . pymongo
pymongo 패키지를 현재 디렉토리에 다운로드합니다.
http%3A%2F%2Fpypi.python.org%2Fpackages%2Fsource%2Fp%2Fpymongo%2Fpymongo-2.1.1.tar.gz
http%3A%2F%2Fpypi.python.org%2Fpackages%2Fsource%2Fp%2Fpymongo%2Fpymongo-2.1.1.tar.gz.content-type
참고 URL : https://stackoverflow.com/questions/10336308/how-to-cache-downloaded-pip-packages
'UFO ET IT' 카테고리의 다른 글
자바에서 두 날짜 사이의 날짜 목록을 얻는 방법 (0) | 2020.12.02 |
---|---|
jQuery : 양식 입력 지우기 (0) | 2020.12.02 |
설치 프로그램 MSI가 오류 코드 1603과 함께 반환되어 AppFabric 설치에 실패했습니다. (0) | 2020.12.02 |
Scrollview는 하나의 직계 자식 만 호스트 할 수 있습니다. (0) | 2020.12.02 |
AngularJS에서 IE 캐시를 방지하는 더 나은 방법? (0) | 2020.12.02 |