十年網(wǎng)站開發(fā)經(jīng)驗(yàn) + 多家企業(yè)客戶 + 靠譜的建站團(tuán)隊(duì)
量身定制 + 運(yùn)營維護(hù)+專業(yè)推廣+無憂售后,網(wǎng)站問題一站解決
這期內(nèi)容當(dāng)中小編將會(huì)給大家?guī)碛嘘P(guān)怎么搭建一個(gè)pypi私有倉庫,文章內(nèi)容豐富且以專業(yè)的角度為大家分析和敘述,閱讀完這篇文章希望大家可以有所收獲。
1. 安裝依賴
pip install pypiserver passlib
2. 創(chuàng)建packages目錄
mkdir packages
3. 以無認(rèn)證方式啟動(dòng)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服務(wù)
使用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]
上述就是小編為大家分享的怎么搭建一個(gè)pypi私有倉庫了,如果剛好有類似的疑惑,不妨參照上述分析進(jìn)行理解。如果想知道更多相關(guān)知識(shí),歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道。