假如在10.0.0.1:8088上搭建pypi-server
1.后台启动pypi-server
Windows:start /b pypi-server -p 8088 packages_dir
Linux:nohup pypi-server -p 8088 packages_dir &
2.客户端如果使用easy_install:
easy_install -i http://10.0.0.1:8088/simple/ PACKAGE
3.客户端使用pip
vim ~/.pip/pip.conf,添加
[global]
extra-index-url = http://10.0.0.1:8080/simple/
trusted-host = 10.0.0.1
4.下载python包(包括依赖包):
pip download PACKAGE --no-binary :all:
需要搭建pypi-server的原因多是因为设备在内网,无法使用pip直接从公网安装,因此可以使用此命令从办公电脑上下载完整的pyhton包再上传到内网pypi-server。