entry_points() got an unexpected keyword argument ‘group‘

@[TOC](python twine上传问题:entry_points() got an unexpected keyword argument ‘group’)

长时间没有更新的软件包,在准备更新的时候发现,上传失败!!!!entry_points() got an unexpected keyword argument ‘group’

检查命令twine check dist/*时报错

Traceback (most recent call last):
  File "/root/anaconda3/bin/twine", line 8, in <module>
    sys.exit(main())
  File "/root/anaconda3/lib/python3.8/site-packages/twine/__main__.py", line 28, in main
    result = cli.dispatch(sys.argv[1:])
  File "/root/anaconda3/lib/python3.8/site-packages/twine/cli.py", line 43, in dispatch
    registered_commands = entry_points(group="twine.registered_commands")
TypeError: entry_points() got an unexpected keyword argument 'group'

importlib-metadata多个版本共存问题

使用python -m pip freeze查看包版本发现

importlib-metadata==3.10.1

再通过python -c "import importlib_metadata;print(importlib_metadata.version('importlib-metadata'))"查看发现importlib-metadata版本为

2.0.0

解决问题问题

两次pip uninstall importlib-metadata就能卸载掉所有,然后重装importlib-metadata,pip install importlib-metadata

结果检查

twine check dist/*

无报错

twine upload dist/*

成功

上一篇:ConcurrentReferenceHashMap


下一篇:hash原理、冲突以及解决方法