You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Commands upgrade and upgrade-all (and possibly others) have an uncaught exception when they are called on a package that was installed with different python version (and probably different virtual environment) than they were installed with.
When calling pipx list, it correctly catches the issue and advices the use of pipx reinstall-all, which fixes the issue.
I've installed few packages when my system was on Python 3.12.
Then upgraded with
sudo pacman -Syyu
This pushed by python version to Python 3.13
Now the packages wouldn't run, then the natural reaction is to upgrade the packages before running them, but this throws uncaught exception:
pipx upgrade selenium ✔ 10m 56s
Traceback (most recent call last):
File "/usr/bin/pipx", line 8, in <module>
sys.exit(cli())
~~~^^
File "/usr/lib/python3.13/site-packages/pipx/main.py", line 1176, in cli
return run_pipx_command(parsed_pipx_args, subparsers)
File "/usr/lib/python3.13/site-packages/pipx/main.py", line 333, in run_pipx_command
return commands.upgrade(
~~~~~~~~~~~~~~~~^
venv_dirs,
^^^^^^^^^^
...<7 lines>...
python_flag_passed=python_flag_passed,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/lib/python3.13/site-packages/pipx/commands/upgrade.py", line 213, in upgrade
_ = _upgrade_venv(
venv_dir,
...<8 lines>...
python_flag_passed=python_flag_passed,
)
File "/usr/lib/python3.13/site-packages/pipx/commands/upgrade.py", line 173, in _upgrade_venv
versions_updated += _upgrade_package(
~~~~~~~~~~~~~~~~^
venv,
^^^^^
...<4 lines>...
upgrading_all=upgrading_all,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/lib/python3.13/site-packages/pipx/commands/upgrade.py", line 45, in _upgrade_package
venv.upgrade_package(
~~~~~~~~~~~~~~~~~~~~^
package_name,
^^^^^^^^^^^^^
...<5 lines>...
suffix=package_metadata.suffix,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/lib/python3.13/site-packages/pipx/venv.py", line 459, in upgrade_package
pip_process = self._run_pip(["--no-input", "install"] + pip_args + ["--upgrade", package_or_url])
File "/usr/lib/python3.13/site-packages/pipx/venv.py", line 476, in _run_pip
return run_subprocess(cmd, run_dir=str(self.root))
File "/usr/lib/python3.13/site-packages/pipx/util.py", line 183, in run_subprocess
completed_process = subprocess.run(
cmd_str_list,
...<6 lines>...
cwd=run_dir,
)
File "/usr/lib/python3.13/subprocess.py", line 554, in run
with Popen(*popenargs, **kwargs) as process:
~~~~~^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.13/subprocess.py", line 1036, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pass_fds, cwd, env,
^^^^^^^^^^^^^^^^^^^
...<5 lines>...
gid, gids, uid, umask,
^^^^^^^^^^^^^^^^^^^^^^
start_new_session, process_group)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.13/subprocess.py", line 1966, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/home/user/.local/share/pipx/venvs/selenium/bin/python'
Same result for upgrading other packages and for passing pipx upgrade-all.
Expected behavior
Generally, I think there should never be an uncaught exception. The ideal situation is what happens when I pass pipx list
pipx list
venvs are in /home/user/.local/share/pipx/venvs
apps are exposed on your $PATH at /home/user/.local/bin
manual pages are exposed at /home/user/.local/share/man
⚠ package selenium has invalid interpreter /usr/bin/python3.12
⚠ package yt-dlp has invalid interpreter /usr/bin/python3.12
One or more packages have a missing python interpreter.
To fix, execute: pipx reinstall-all
This is very clear output that explains what I need to do.
The text was updated successfully, but these errors were encountered:
Commands upgrade and upgrade-all (and possibly others) have an uncaught exception when they are called on a package that was installed with different python version (and probably different virtual environment) than they were installed with.
When calling pipx list, it correctly catches the issue and advices the use of pipx reinstall-all, which fixes the issue.
How to reproduce
Tested on two Manjaro systems:
I've installed few packages when my system was on Python 3.12.
Then upgraded with
sudo pacman -Syyu
This pushed by python version to Python 3.13
Now the packages wouldn't run, then the natural reaction is to upgrade the packages before running them, but this throws uncaught exception:
Same result for upgrading other packages and for passing pipx upgrade-all.
Expected behavior
Generally, I think there should never be an uncaught exception. The ideal situation is what happens when I pass pipx list
This is very clear output that explains what I need to do.
The text was updated successfully, but these errors were encountered: