[记]pypi打包上传
提示:Upload failed (403): Invalid or non-existent authentication information 参考解决方法
环境 python 3.8.10
第一步:编写setup.py文件用于打包:
setup.py文件编写参考:
Python 自定义模块的打包和发布 - Yemilice - 博客园 (cnblogs.com)
# coding: utf-8 from distutils.core import setup setup(name='elasticdb', #打包后的包文件名 version='1.0', description='elasticsearch backpack', #说明 author='liu.xxxxx', author_email='liu.xxxxxx@xxxxxxxxx', url='YEYE', py_modules=['elasticdb.es_check','elasticdb.es_config','elasticdb.es_log','elasticdb.es_sysdb'], #你要打包的文件 )
第二步:python setup.py build 验证包正确性
第三步:python setup.py sdist 生成包
位于dist目录下
第四步:使用twine模块上传打包好的包:
twine upload dist/*
将提示输入账号密码,pypi注册自备
-------------====================分割线====================-------------