Skip to content

[feature] Download/use standalone python build when chose --python version doesn't exist #1242

@alextremblay

Description

@alextremblay

How would this feature be useful?

It would be awesome if we could run pipx run --python=python3.10 cowsay hello and have it just work, even if we didn't have python3.10 installed locally

It would be awesome if we could share scripts with colleagues that start with #!/usr/bin/env -S pipx run --python=python3.11 and have it just work even if said colleagues don't have python 3.11 installed

Describe the solution you'd like

my idea would be to modify pipx.interpreter.find_python_interpreter so that if it's not able to find a python binary matching what the user requested with the --python flag, rather than failing with an exception, the funtion would first attempt to download and unpack a python standalone build to a local cache directory (PIPX_HOME/py for example) and use that

Describe alternatives you've considered

AFAIK there is not currently a workaround / way to do this in pipx, other than to instruct all users of saind scripts / tools to manually install the correct version of python in one of the myriad ways that python can be installed on a given system

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions