为什么我的包无法安装 "pipx"?

Why my package can't be installed with "pipx"?

我有一个 Python 项目 aws-ssm-tools,它使用 setup.py 进行打包。它带有 3 个脚本:ssm-tunnelssm-sessionssm-copy.

它可以用 pip install aws-ssm-tools 安装并将脚本放入 ~/.local/bin/

然而,当我尝试使用 pipx 安装它时,它失败了:

~ $ pipx install aws-ssm-tools

No apps associated with package aws-ssm-tools. Try again with '--include-deps' 
to include apps of dependent packages, which are listed above. If you are 
attempting to install a library, pipx should not be used. Consider using pip or 
a similar tool instead.

我有 setup.py 中指定的脚本:

SCRIPTS = [
    'ssm-session',
    'ssm-copy',
    'ssm-tunnel',
    'ssm-tunnel-updown.dns-example',
]

# ...

setup(
    name="aws-ssm-tools",
    version=VERSION,
    packages=find_packages(),
    scripts=SCRIPTS+[
        'ssm-tunnel-agent'
    ],
    # ...
)

我还需要做些什么才能让 pipx 开心?

pipx documentation chapter "How pipx works", section "Developing for pix", the project requires setuptools entry_points 中所述。

根据你提问的内容,目标项目似乎使用了scripts,它们的目的与entry-points类似,但pipx不寻找那些,也不暴露它们。