1

1. 安装依赖

pip install pypiserver passlib

2. 创建packages目录

mkdir packages

3. 以无认证方式启动pypiserver

pypi-server -p 8080 -P . -a . ./packages

4. 编写.pypirc配置文件

[distutils]
index-servers =
  pypi
  local

[pypi]
username:xxx
password:xxxx

[local]
repository:http://localhost:8080
username:
password:

5. 上传到私有pypi服务

使用setuptools上传

python setup.py sdist bdist_wheel upload -r local

使用twine上传

twine upload -r local dist/*

安装

首先修改.pip.ini配置文件如下:

[global]
index-url=https://pypi.douban.com/simple
extra-index-url=
    http://localhost:8080/simple/
    https://mirrors.aliyun.com/pypi/simple/
    https://mirrors.cloud.tencent.com/pypi/simple
    https://pypi.tuna.tsinghua.edu.cn/simple/
    https://pypi.doubanio.com/simple/
    https://mirrors.163.com/pypi/simple/

[install]
trusted-host=
    localhost:8080
    pypi.douban.com
    mirrors.aliyun.com
    mirrors.cloud.tencent.com
    pypi.tuna.tsinghua.edu.cn
    pypi.doubanio.com
    mirrors.163.com

安装

pip install [package-name]

zxyle
47 声望0 粉丝