Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wrong pipx command to run with python 3.12 interpreter. #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mrswats
Copy link

@mrswats mrswats commented Nov 26, 2024

I just tried out the textual demo running pipx and I got hit by an error:

$ pipx run --python 3.12 textual-demo
Traceback (most recent call last):
  File "/home/fjm/.local/bin/pipx", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/home/fjm/.share/pipx/lib64/python3.12/site-packages/pipx/main.py", line 885, in cli
    return run_pipx_command(parsed_pipx_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/fjm/.share/pipx/lib64/python3.12/site-packages/pipx/main.py", line 197, in run_pipx_command
    commands.run(
  File "/home/fjm/.share/pipx/lib64/python3.12/site-packages/pipx/commands/run.py", line 200, in run
    run_package(
  File "/home/fjm/.share/pipx/lib64/python3.12/site-packages/pipx/commands/run.py", line 157, in run_package
    _download_and_run(
  File "/home/fjm/.share/pipx/lib64/python3.12/site-packages/pipx/commands/run.py", line 234, in _download_and_run
    venv.create_venv(venv_args, pip_args, override_shared)
  File "/home/fjm/.share/pipx/lib64/python3.12/site-packages/pipx/venv.py", line 160, in create_venv
    venv_process = run_subprocess(cmd + venv_args + [str(self.root)])
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/fjm/.share/pipx/lib64/python3.12/site-packages/pipx/util.py", line 174, in run_subprocess
    completed_process = subprocess.run(
                        ^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/subprocess.py", line 548, in run
    with Popen(*popenargs, **kwargs) as process:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib64/python3.12/subprocess.py", line 1955, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '3.12'

But changing it to

pipx run --python python3.12 textual-demo

worked just fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant