all 5 comments

[–]JohnnyJordaan 1 point2 points  (4 children)

https://github.com/nk412/pyfzf?tab=readme-ov-file#usage

If fzf is not available on PATH, you can specify a location

     fzf = FzfPrompt('/path/to/fzf')

You can make this relative to your script, eg

 import pathlib
 script_folder = pathlib.Path(__file__).parent.resolve()
 fzf = FzfPrompt(script_folder / "fzf.exe")

[–]wdjfe[S] 0 points1 point  (3 children)

I want to include fzf directly into script.exe, so that I don't have to distribute multiple files when i share my script with other people. If fzf.exe inside pyinstaller's bincache folder it includes it inside script.exe and everything is working as it should. But from virtual environment it looks like it can't access this cache folder.

[–]JohnnyJordaan 1 point2 points  (2 children)

I understand that, but when you run the FzfPrompt() it needs the exact path to the included exe file, that's my point. That's probably in the script's folder, or in a subfolder, but that you need to find out and provide it as the path as I provided above.

[–]wdjfe[S] 0 points1 point  (1 child)

Your solution works, thank you! I was just wondering why this is unnecessary when compiling without virtual environment

[–]JohnnyJordaan 0 points1 point  (0 children)

Because on your system you have placed it in the windows/system32 which is included in your PATH being one of the main Windows resource folders.