diff --git a/src/pipx/main.py b/src/pipx/main.py index 25f9ad08f8..d829d1a227 100644 --- a/src/pipx/main.py +++ b/src/pipx/main.py @@ -181,10 +181,12 @@ def run_pipx_command(args: argparse.Namespace) -> ExitCode: # noqa: C901 logger.info(f"Virtual Environment location is {venv_dir}") if "skip" in args: skip_list = [canonicalize_name(x) for x in args.skip] - if "python" in args and not Path(args.python).is_file(): - py_launcher_python = find_py_launcher_python(args.python) - if py_launcher_python: - args.python = py_launcher_python + + if "python" in args: + if args.python is not None and not Path(args.python).is_file(): + py_launcher_python = find_py_launcher_python(args.python) + if py_launcher_python: + args.python = py_launcher_python if args.command == "run": commands.run(