日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

企业内网利用devpi搭建pypi私服

發布時間:2023/12/19 编程问答 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 企业内网利用devpi搭建pypi私服 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

安裝devpi

概述

devpi包含三個組件:

  • devpi-server: 提供鏡像與緩存功能,在企業DMZ區部署,提高下載python package的效率
  • devpi-web: 提供web界面與查詢功能
  • devpi-client: 命令行工具, 提供包上傳等功能

devpi-server

# 若devpi-server與互聯網不通,可通過設置代理來安裝 # pip --proxy http://proxy_server:3128 install -q -U devpi-serverpip install -q -U devpi-server devpi-server --version

初始化與初次啟動

devpi-server --init devpi-server --start

測試

pip install -i http://localhost:3141/root/pypi/ simplejson pip uninstall -y simplejson easy_install -i http://localhost:3141/root/pypi/+simple/ simplejson pip uninstall -y simplejson

devpi-web

pip install -q -U devpi-web devpi-server --stop devpi-server --recreate-search-index devpi-server --start pip search --index http://localhost:3141/root/pypi/ devpi-client

常用命令

devpi-server --init devpi-server --start devpi-server --stop devpi-server --status devpi-server --log

devpi behind proxy

export http_proxy="http://proxy_server:3128" export https_proxy="http://proxy_server:3128" export no_proxy="localhost,10.0.0.0/8,172.16.0.0/12" devpi-server --start

nginx reverse proxy

# http block upstream pypi.example.com {server 127.0.0.1:3141;keepalive 16; }# server block location ~ /(root|\+search) {proxy_pass http://pypi.example.com;proxy_http_version 1.1;proxy_set_header Connection "";proxy_set_header Host $host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; }

客戶端設置

pip

# Linux: $HOME/.pip/pip.conf # Windows 7: C:\ProgramData\pip\pip.ini # windows xp: C:\Documents and Settings\All Users\Application Data\pip\pip.ini # or use environment variable PIP_CONFIG_FILE to specify location# please replace example.com to your REAL domain name[global] index-url = http://pypi.example.com/root/pypi/+simple/[install] trusted-host=pypi.example.com[search] index = http://pypi.example.com/root/pypi/

easy_install

# $HOME/.pydistutils.cfg: [easy_install] index_url = http://pypi.example.com/root/pypi/+simple/

參考

  • Quickstart: running a pypi mirror on your
    laptop
  • Configure devpi-server to work behind proxy server at
    workplace


作者:田園牧歌w
鏈接:https://www.jianshu.com/p/cc600c36e549
來源:簡書
著作權歸作者所有。商業轉載請聯系作者獲得授權,非商業轉載請注明出處。

總結

以上是生活随笔為你收集整理的企业内网利用devpi搭建pypi私服的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。