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

Extra .exe suffix on assumed path - Assuming app is 'pip_search.exe.exe' (Windows only) and [WinError 2] The system cannot find the file specified running pipx run <package> #1189

Closed
Spitfire1900 opened this issue Jan 5, 2024 · 4 comments
Labels
bug Something isn't working windows

Comments

@Spitfire1900
Copy link
Contributor

When running any pipx run command the following stack trace is thrown

PS C:\Bitbucket> pipx run  -v --no-cache pip-search
pipx >(setup:850): pipx version is 1.4.1
pipx >(setup:851): Default python interpreter is 'C:\Users\XXXXXXX\.pyenv\pyenv-win\versions\3.11.7\python.exe'
pipx >(run_package:129): Assuming app is 'pip-search.exe' (Windows only)
pipx >(run_subprocess:168): running <checking pip's availability>
pipx >(needs_upgrade:77): Time since last upgrade of shared libs, in seconds: 804285. Upgrade will be run by pipx if greater than 2592000.
pipx >(run_subprocess:168): running <checking pip's availability>
pipx >(run_subprocess:168): running C:\Users\XXXXXXX\AppData\Local\pipx\pipx\Cache\13a61f997a2511b\Scripts\python.exe -c import sysconfig; print(sysconfig.get_path('purelib'))
pipx >(run_package:156): venv location is C:\Users\XXXXXXX\AppData\Local\pipx\pipx\Cache\13a61f997a2511b
pipx >(run_subprocess:168): running <checking pip's availability>
pipx >(run_subprocess:168): running <checking pip's availability>
creating virtual environment...
pipx >(run_subprocess:168): running C:\Users\XXXXXXX\.pyenv\pyenv-win\versions\3.11.7\python.exe -m venv --without-pip C:\Users\XXXXXXX\AppData\Local\pipx\pipx\Cache\13a61f997a2511b
pipx >(run_subprocess:168): running <checking pip's availability>
pipx >(run_subprocess:168): running C:\Users\XXXXXXX\AppData\Local\pipx\pipx\Cache\13a61f997a2511b\Scripts\python.exe -c import sysconfig; print(sysconfig.get_path('purelib'))
pipx >(run_subprocess:168): running C:\Users\XXXXXXX\AppData\Local\pipx\pipx\shared\Scripts\python.exe -c import sysconfig; print(sysconfig.get_path('purelib'))
pipx >(run_subprocess:168): running C:\Users\XXXXXXX\AppData\Local\pipx\pipx\Cache\13a61f997a2511b\Scripts\python.exe --version
pipx >(_parsed_package_to_package_or_url:137): cleaned package spec: pip-search
installing pip-search...
pipx >(run_subprocess:168): running C:\Users\XXXXXXX\AppData\Local\pipx\pipx\Cache\13a61f997a2511b\Scripts\python.exe -m pip --no-input install pip-search
pipx >(run_subprocess:168): running <fetch_info_in_venv commands>
pipx >(get_venv_metadata_for_package:339): get_venv_metadata_for_package: 2195ms
pipx >(_parsed_package_to_package_or_url:137): cleaned package spec: pip-search
pipx >(run_subprocess:168): running C:\Users\XXXXXXX\AppData\Local\pipx\pipx\Cache\13a61f997a2511b\Scripts\python.exe -c import sysconfig; print(sysconfig.get_path('purelib'))
NOTE: running app 'pip_search.exe' from 'pip-search'
pipx >(_download_and_run:253): Assuming app is 'pip_search.exe.exe' (Windows only)
pipx >(run_subprocess:168): running C:\Users\XXXXXXX\AppData\Local\pipx\pipx\Cache\13a61f997a2511b\Scripts\python.exe -c import sysconfig; print(sysconfig.get_path('purelib'))
pipx >(exec_app:370): exec_app: C:\Users\XXXXXXX\AppData\Local\pipx\pipx\Cache\13a61f997a2511b\Scripts\pip_search.exe.exe
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\XXXXXXX\.pyenv\pyenv-win\versions\3.11.7\Scripts\pipx.exe\__main__.py", line 7, in <module>
  File "C:\Users\XXXXXXX\.pyenv\pyenv-win\versions\3.11.7\Lib\site-packages\pipx\main.py", line 911, in cli
    return run_pipx_command(parsed_pipx_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\XXXXXXX\.pyenv\pyenv-win\versions\3.11.7\Lib\site-packages\pipx\main.py", line 197, in run_pipx_command
    commands.run(
  File "C:\Users\XXXXXXX\.pyenv\pyenv-win\versions\3.11.7\Lib\site-packages\pipx\commands\run.py", line 200, in run
    run_package(
  File "C:\Users\XXXXXXX\.pyenv\pyenv-win\versions\3.11.7\Lib\site-packages\pipx\commands\run.py", line 157, in run_package
    _download_and_run(
  File "C:\Users\XXXXXXX\.pyenv\pyenv-win\versions\3.11.7\Lib\site-packages\pipx\commands\run.py", line 271, in _download_and_run
    venv.run_app(app, app_filename, app_args)
  File "C:\Users\XXXXXXX\.pyenv\pyenv-win\versions\3.11.7\Lib\site-packages\pipx\venv.py", line 402, in run_app
    exec_app([str(self.bin_path / filename)] + app_args)
  File "C:\Users\XXXXXXX\.pyenv\pyenv-win\versions\3.11.7\Lib\site-packages\pipx\util.py", line 374, in exec_app
    subprocess.run(
  File "C:\Users\XXXXXXX\.pyenv\pyenv-win\versions\3.11.7\Lib\subprocess.py", line 548, in run
    with Popen(*popenargs, **kwargs) as process:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\XXXXXXX\.pyenv\pyenv-win\versions\3.11.7\Lib\subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Users\XXXXXXX\.pyenv\pyenv-win\versions\3.11.7\Lib\subprocess.py", line 1538, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [WinError 2] The system cannot find the file specified

I think the issue is noted by Assuming app is 'pip_search.exe.exe' (Windows only)

Expected behavior

The command should be ran as expected.

@Spitfire1900 Spitfire1900 changed the title Assuming app is 'pip_search.exe.exe' (Windows only) [WinError 2] The system cannot find the file specified running return run_pipx_command(parsed_pipx_args) Exter .exe suffix on assumed path - Assuming app is 'pip_search.exe.exe' (Windows only) and [WinError 2] The system cannot find the file specified running pipx run <package> Jan 5, 2024
@Spitfire1900 Spitfire1900 changed the title Exter .exe suffix on assumed path - Assuming app is 'pip_search.exe.exe' (Windows only) and [WinError 2] The system cannot find the file specified running pipx run <package> Extra .exe suffix on assumed path - Assuming app is 'pip_search.exe.exe' (Windows only) and [WinError 2] The system cannot find the file specified running pipx run <package> Jan 5, 2024
@Spitfire1900
Copy link
Contributor Author

This reproduces at least as far back a 1.2.1

@Spitfire1900
Copy link
Contributor Author

Added breakpoint to pipx/util.py:

(Pdb) cmd
['C:\\Users\\XXXXXXX\\.local\\pipx\\.cache\\13a61f997a2511b\\Scripts\\pip_search.exe.exe']
(Pdb) bt
  <frozen runpy>(198)_run_module_as_main()
  <frozen runpy>(88)_run_code()
  c:\users\XXXXXXX\.pyenv\pyenv-win\versions\3.11.7\scripts\pipx.exe\__main__.py(7)<module>()
-> sys.exit(cli())
  c:\users\XXXXXXX\appdata\roaming\python\python311\site-packages\pipx\main.py(911)cli()
-> return run_pipx_command(parsed_pipx_args)
  c:\users\XXXXXXX\appdata\roaming\python\python311\site-packages\pipx\main.py(197)run_pipx_command()
-> commands.run(
  c:\users\XXXXXXX\appdata\roaming\python\python311\site-packages\pipx\commands\run.py(200)run()
-> run_package(
  c:\users\XXXXXXX\appdata\roaming\python\python311\site-packages\pipx\commands\run.py(157)run_package()
-> _download_and_run(
  c:\users\XXXXXXX\appdata\roaming\python\python311\site-packages\pipx\commands\run.py(271)_download_and_run()
-> venv.run_app(app, app_filename, app_args)
  c:\users\XXXXXXX\appdata\roaming\python\python311\site-packages\pipx\venv.py(402)run_app()
-> exec_app([str(self.bin_path / filename)] + app_args)
> c:\users\XXXXXXX\appdata\roaming\python\python311\site-packages\pipx\util.py(387)exec_app()
-> print('breakpoint')

@Spitfire1900
Copy link
Contributor Author

In the above example a workaround is pipx run --spec=pip-search pip_search

@chrysle chrysle added bug Something isn't working windows labels Jan 5, 2024
@Spitfire1900
Copy link
Contributor Author

Have not reproduced this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working windows
Projects
None yet
Development

No branches or pull requests

2 participants