惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

爱范儿
爱范儿
博客园_首页
W
WeLiveSecurity
S
Secure Thoughts
S
Security @ Cisco Blogs
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Hugging Face - Blog
Hugging Face - Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
H
Hacker News: Front Page
Project Zero
Project Zero
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
U
Unit 42
N
News and Events Feed by Topic
N
News and Events Feed by Topic
Hacker News - Newest:
Hacker News - Newest: "LLM"
Forbes - Security
Forbes - Security
T
Tor Project blog
I
Intezer
B
Blog
F
Full Disclosure
Security Archives - TechRepublic
Security Archives - TechRepublic
F
Fortinet All Blogs
Schneier on Security
Schneier on Security
T
Threat Research - Cisco Blogs
AI
AI
Google DeepMind News
Google DeepMind News
L
LINUX DO - 最新话题
Cloudbric
Cloudbric
L
Lohrmann on Cybersecurity
WordPress大学
WordPress大学
博客园 - 聂微东
雷峰网
雷峰网
P
Privacy International News Feed
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
PCI Perspectives
PCI Perspectives
Y
Y Combinator Blog
Spread Privacy
Spread Privacy
Simon Willison's Weblog
Simon Willison's Weblog
罗磊的独立博客
Vercel News
Vercel News
A
Arctic Wolf
The Register - Security
The Register - Security
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Microsoft Azure Blog
Microsoft Azure Blog
H
Heimdal Security Blog
Know Your Adversary
Know Your Adversary
P
Proofpoint News Feed
C
Cybersecurity and Infrastructure Security Agency CISA
P
Proofpoint News Feed

博客园 - fengjian1585

关闭ingress 8443 端口 tomcat 设置 catalina.out 按天切割 Harbor 启用 Trivy 禁用 MinIO 的 Web Console 重定向功能 堆设置了8G,java进程却占用了12G内存 k8s优化选项 pod启动后一直containerCreating状态解决 Kubernetes Cilium网络组件和CoreDNS配置 mkfs对磁盘设置标签 K8S的CoreDns配置文件添加域名解析 nginx代理两套k8s ingress 不同域名 使用 kubectl debug 创建临时调试容器 openvpn server证书过期处理 - fengjian1585 Harbor Swagger接口泄露漏洞处理 "too many open files" 文件句柄 Kafka 常见故障及解决方案 华为昇腾 910B GPU Nginx与Upstream之间产生大量TIME_WAIT连接的解决办法 debian libc.musl-x86_64.so.1 => not found
pip 搭建源
fengjian1585 · 2025-09-17 · via 博客园 - fengjian1585

搭建本地pip源主要可通过pypiserver、pip2pi或bandersnatch等工具实现,具体步骤如下:

工具选择与安装

‌pypiserver‌:轻量级方案,适合快速搭建小型私有源,通过pip install pypiserver安装
‌pip2pi‌:适合按需构建源,从requirements.txt生成索引,需配合pip install pip2pi安装
‌bandersnatch‌:企业级方案,可完整同步官方PyPI镜像,但占用空间较大

目录与包管理
创建存放包的目录,如mkdir ~/packages

下载所需包到目录:

使用  pip download -d /path/to/packages -r requirements.txt下载指定依赖包

或通过bandersnatch同步完整镜像

服务启动与索引生成
‌pypiserver‌:

在包目录执行pypi-server run ./启动服务,默认监听8080端口

‌pip2pi‌:

运行dir2pi /path/to/packages生成HTML索引文件(Windows需忽略符号链接错误)

客户端配置
修改pip配置文件(~/.pip/pip.conf或%APPDATA%\pip\pip.ini),添加本地源地址:

[global]
index-url = http://本地IP:端口/simple
trusted-host = 本地IP