搭建私有pypi-server

0.本身已经安装python3.6

1.从外网下载解压pypiserver-master.zip
进入文件夹pypiserver-master
执行python setup.py  install

提示缺少wheel
从外网下载解压缩wheel-0.33.6.tar.gz
进入文件夹:wheel-0.33.6
执行
python setup.py  install

2.再次进入文件夹pypiserver-master
执行python setup.py  install
提示缺少

从外网下载解压缩setuptools-git-1.2.tar.gz
进入文件夹:setuptools-git-1.2
执行python setup.py  install

3.再次进入文件夹pypiserver-master
执行python setup.py  install  报错,提示需要目录
创建文件夹G:\pypiserver
执行pip install -d G:\pypiserver   pypiserver
成功

4.创建文件夹G:\pypiserver
启动pypiserver
pypi-server  G:\pypiserver  #默认8080
可以主动指定端口
pypi-server  -p9090  G:\pypiserver
访问  http://localhost:8080/  如果显示
"
Welcome to pypiserver!
This is a PyPI compatible package index serving 0 packages.
To use this server with pip, run the the following command:
pip install --extra-index-url http://localhost:8080/ PACKAGE [PACKAGE2...]
To use this server with easy_install, run the the following command:
easy_install -i http://localhost:8080/simple/ PACKAGE
The complete list of all packages can be found here or via the simple index.
This instance is running version 1.3.0 of the pypiserver software.
"
就是正常的

将自己编译好(python setup.py sdist)的包ccy-1.0.tar.gz放入目录 G:\pypiserver
卷 G 的文件夹 PATH 列表
卷序列号为 9C1E-658D
G:.
├─c11
│  ├─c111
│  │  └─__pycache__
│  └─__pycache__
├─c12
└─__pycache__
开始安装
pip install --extra-index-url http://localhost:8080/ ccy
pip install --extra-index-url http://localhost:8080/ ccy==1.0 #最好制定版本

卸载安装的包
pip uninstall ccy

--- 为了方便卸载,安装的时候需要写入日志
python setup.py install --record log
cat log|xagrs rm -rf

也可以用easy_install安装
easy_install -i http://localhost:8080/simple/ ccy
在我的环境中用这种不带版本的安装方式,python需要在引用包的时候添加如下语句
import pkg_resources
pkg_resources.require("ccy==1.0")

easy_install -i http://localhost:8080/simple/ ccy==1.0

卸载安装的包
easy_install -m ccy

测试脚本:
#TestMyPkg.py
#import pkg_resources
#pkg_resources.require("ccy==1.0")
import c11.f11
c11.f11.my11.showmyself()

转载于:https://www.cnblogs.com/cquccy/p/11395123.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值