-
Notifications
You must be signed in to change notification settings - Fork 128
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
yapf FileNotFoundError #783
Comments
Looks like |
Note that pyinstaller/pyinstaller#4939 has nothing to do with this issue. You have a |
Thanks! That did the trick! Out of curiosity, when I inspect the _internal directory of the dist, it still doesn't have the yapf module dir where it has others like onnx, torch etc. This will help me have a better understanding of pyinstaller to diagnose future issues, as I've encountered similar issues before. Thanks a bunch! |
I'm sorry, you're right. I guess my understanding of this is incorrect. If you have more details about this process, could you please share that? Thanks! |
Python files don't appear on the file system. They're bytecompiled and put in a zip-like archive inside the exe file. |
Oh the base-library.zip file? Or inside the exe in the onedir mode too? And all the module-named directories like onnxruntime, torch that appear in the _internal directory are only there to keep the data files associated with those modules? |
No,
Yes. Data files and binaries - bundled shared libraries and binary extension modules. Although for some packages, like |
Sorry for returning late to this. Very helpful details, thanks a lot! I'll check out the archive viewer as well, sounds quite useful.
Is this because of aten and how the python API wraps over it, or because some configs are stored in .py files? |
Torch takes plain source code and feeds it to its special JIT compiler. Occasionally, other libraries try to use source code for things they shouldn't. They will almost always be using |
Description of the issue
yapf is used in the groundingDINO project.
Using pyinstaller to build a onedir executable.
yapf is not included in the onedir/_internal packages, and so module not found error is encountered on running the frozen application.
Context information (for bug reports)
pyinstaller --version
:6.10
I have already tried adding yapf to hiddenimports.
--noupx
or setupx=False
in your .spec-file--debug
topyi-makespec
orpyinstaller
or useEXE(..., debug=1, ...)
in your .spec file.: TRIED (that's how discovered the error msg)On manually copy-pasting the yapf module from my python installation into the onedir/_internal directory, the application works as expected.
So this seems a problem of yapf not being recognised and exported properly.
I'm using a .spec file to construct the executable.
Exe runs fine until the feature/piece of code that uses the yapf module is encountered.
A minimal example program which shows the error
FileNotFoundError: No such file or directory:
path/to/dist/main/_internal/yapf_third_party/_ylib2to3/Grammar.txt
Reported earlier in pyinstaller/pyinstaller#4939 in 2020 but closed as stale
The text was updated successfully, but these errors were encountered: