0

在 Windows 10 上。

尝试遵循https://packaging.python.org/tutorials/packaging-projects/,适应 python 2.7

没有看到任何来自 twine 的位置参数——不知道如何调试。以下是卸载 twine 后的内容。

$>pip install --user twine
Collecting twine
  Using cached https://files.pythonhosted.org/packages/26/7f/92c7083b66bc7ed32940cc0e25ae070c033d384d158617635222e7a08e92/twine-1.12.1-py2.py3-none-any.whl
Requirement already satisfied: requests!=2.15,!=2.16,>=2.5.0 in c:\users\lking\anaconda2\lib\site-packages (from twine) (2.19.1)
Requirement already satisfied: setuptools>=0.7.0 in c:\users\lking\anaconda2\lib\site-packages (from twine) (40.6.3)
Requirement already satisfied: requests-toolbelt>=0.8.0 in c:\users\lking\appdata\roaming\python\python27\site-packages (from twine) (0.8.0)
Requirement already satisfied: tqdm>=4.14 in c:\users\lking\appdata\roaming\python\python27\site-packages (from twine) (4.28.1)
Requirement already satisfied: readme-renderer>=21.0 in c:\users\lking\appdata\roaming\python\python27\site-packages (from twine) (24.0)
Requirement already satisfied: pkginfo>=1.4.2 in c:\users\lking\appdata\roaming\python\python27\site-packages (from twine) (1.4.2)
Requirement already satisfied: idna<2.8,>=2.5 in c:\users\lking\anaconda2\lib\site-packages (from requests!=2.15,!=2.16,>=2.5.0->twine) (2.7)
Requirement already satisfied: urllib3<1.24,>=1.21.1 in c:\users\lking\anaconda2\lib\site-packages (from requests!=2.15,!=2.16,>=2.5.0->twine) (1.23)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in c:\users\lking\anaconda2\lib\site-packages (from requests!=2.15,!=2.16,>=2.5.0->twine) (3.0.4)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\lking\anaconda2\lib\site-packages (from requests!=2.15,!=2.16,>=2.5.0->twine) (2018.4.16)
Requirement already satisfied: bleach>=2.1.0 in c:\users\lking\appdata\roaming\python\python27\site-packages (from readme-renderer>=21.0->twine) (3.0.2)
Requirement already satisfied: Pygments in c:\users\lking\anaconda2\lib\site-packages (from readme-renderer>=21.0->twine) (2.2.0)
Requirement already satisfied: docutils>=0.13.1 in c:\users\lking\anaconda2\lib\site-packages (from readme-renderer>=21.0->twine) (0.13.1)
Requirement already satisfied: six in c:\users\lking\anaconda2\lib\site-packages (from readme-renderer>=21.0->twine) (1.11.0)
Requirement already satisfied: webencodings in c:\users\lking\appdata\roaming\python\python27\site-packages (from bleach>=2.1.0->readme-renderer>=21.0->twine) (0.5.1)
Installing collected packages: twine
Successfully installed twine-1.12.1

上传失败

$>twine upload --repository-url https://test.pypi.org/legacy/ dist/*
usage: twine [-h] [--version] {}
twine: error: argument command: invalid choice: 'upload' (choose from )

没有上传或任何其他命令

$>twine -h
usage: twine [-h] [--version] {}

positional arguments:
  {}

optional arguments:
  -h, --help  show this help message and exit
  --version   show program's version number and exit
4

1 回答 1

1

我已经安装了分发 0.6.14,所以 twine 选择了错误的 pkg_resources。

pip uninstall distribute

解决了问题

于 2018-12-17T16:36:19.973 回答