자신의 pip 소스 구축
pip 로 설치:
$ pip install bandersnatch
원본 코드 로 설치:
$ wget https://pypi.python.org/packages/source/b/bandersnatch/bandersnatch-1.5.tar.gz
$ tar -zxvf bandersnatch-1.5.tar.gz
$ cd bandersnatch-1.5
$ python setup.py install
2.Configure
프로필 생 성 / etc / bandersnatch. conf.
$ bandersnatch mirror
2014-09-15 09:37:30,631 WARNING: Config file '/etc/bandersnatch.conf' missing, creating default config.
2014-09-15 09:37:30,631 WARNING: Please review the config file, then run 'bandersnatch' again.
/ etc / bandersnatch. conf 는 실제 상황 에 따라 다음 두 가지 설정 을 중점적으로 수정 합 니 다. directory 는 package 가 로 컬 에 저 장 된 위 치 를 말 합 니 다. master 는 동기 화 된 원본 을 말 합 니 다.
[mirror]
; The directory where the mirror data will be stored.
directory = /srv/pypi
; The PyPI server which will be mirrored.
; master = https://testpypi.python.org
; scheme for PyPI server MUST be https
master = https://pypi.python.org
3.Download & Synchronize
모든 package 를 로 컬 로 다운로드:
$ bandersnatch -c /etc/bandersnatch.conf mirror
2014-01-15 09:49:26,556 INFO: bandersnatch/1.5 (CPython 2.7.6-final0, Linux 3.19.0-37-generic x86_64)
2014-01-15 09:49:26,558 INFO: Setting up mirror directory: /srv/pypi/
2014-01-15 09:49:26,559 INFO: Setting up mirror directory: /srv/pypi/web/simple
2014-01-15 09:49:26,560 INFO: Setting up mirror directory: /srv/pypi/web/packages
2014-01-15 09:49:26,560 INFO: Setting up mirror directory: /srv/pypi/web/local-stats/days
2014-01-15 09:49:26,561 INFO: Generation file missing. Reinitialising status files.
......
로 컬 pacakge 업데이트:
$ bandersnatch -c /etc/bandersnatch.conf mirror
2014-09-15 09:54:35,813 INFO: bandersnatch/1.5 (CPython 2.7.6-final0, Linux 3.19.0-37-generic x86_64)
2014-09-15 09:54:35,814 INFO: Status file missing. Starting over.
2014-09-15 09:54:35,814 INFO: Syncing with https://pypi.python.org.
2014-09-15 09:54:35,815 INFO: Current mirror serial: 0
2014-09-15 09:54:35,815 INFO: Resuming interrupted sync from local todo list.
4.Config nginx
설치 nginx:
$ apt-get install nginx
/ etc / nginx / sites - available / default 와 / etc / nginx / sites - available / default 설정 은 다음 과 같 습 니 다.
server {
listen *:80;
server_name pypi_server;
root /srv/pypi/web;
autoindex on;
charset utf-8;
}
시작 nginx:
$ /etc/init.d/nginx start
5.Test
클 라 이언 트 pip 설정:
$ cat ~/.pip/pip.conf
[global]
index-url = http:///simple
테스트 는 다음 과 같 습 니 다:
$ pip install apasvo
Downloading/unpacking apasvo
http:///simple/apasvo/ uses an insecure transport scheme (http). Consider using https if has it available
Downloading APASVO-0.0.5-py2-none-any.whl (226kB): 226kB downloaded
......
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
다양한 언어의 JSONJSON은 Javascript 표기법을 사용하여 데이터 구조를 레이아웃하는 데이터 형식입니다. 그러나 Javascript가 코드에서 이러한 구조를 나타낼 수 있는 유일한 언어는 아닙니다. 저는 일반적으로 '객체'{}...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.