Pyinstaller Cannot Find File After Compiling
Prerequisites
- I am running the latest code. Development is very rapid so there are no tagged versions as of now.
- I carefully followed the README.md.
- I searched using keywords relevant to my issue to make sure that I am creating a new issue that is not already open (or closed). -I reviewed the Discussions, and have a new bug or useful enhancement to share.
Expected Behavior
I am confident that llama-cpp-python shouldn't act like this after being converted to an executable. I expect the file to properly locate the necessary files after the executable is run.
Current Behavior
After compiling my FastAPI backend to an executable (uses llama-cpp-python as a dependency) I try to run the executable, I am met with the following error:
Traceback (most recent call last):
File "main.py", line 12, in
In the first place, there is no AppData directory on my machine, and there is no NATHAN~1 user on my machine.
Environment and Context
I am using an Anaconda environment on Windows, I don't think that the other dependencies are causing this bug, it's probably got something to do with how the python bindings load the llama_cpp dependency, which is loaded on installation of the module.
- Physical Windows 11
$ python3 --version
3.12.3
Steps to Reproduce
Please provide detailed steps for reproducing the issue. We are not sitting in front of your screen, so the more detail the better.
- Create a python file that uses llama-cpp-python
- Convert the python file to an executable with pyinstaller example.py
- Run the executable in the dist folder
Have you found any solution for this?
+1
+1
for future users https://github.com/abetlen/llama-cpp-python/pull/709/files