You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using pyinstaller to package a py file, it's default behavior is to put all the dependencies in the root folder with the exe file. This is not neat to end users, looks so unneat.
A simple hello.py could end up a mess in the exe folder:
not to mention big projects that use many site-packages modules would end up like.
So I wish there could be a mode, or a flag, to put all the dependency files into one subfolder of the exe folder root.
It is viable, now I can make this by modifying the spec file and adding a hook file:
And the packaged folder looks like this, very nice and clean:
Of course, the exe file runs normally, since I have add the libs folder to the sys.path in the hook.py.
I wish this kind of feature could be add to PyInstaller, so users can benifit from this by simply adding an option when using pyinstaller.
The Zen of Python:
The Zen of Python, by Tim Peters
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!
The text was updated successfully, but these errors were encountered:
Duplicate of #5575. For your current proof of concept, any package with its data files banished to libs will still look for those data files in their original locations so the show stops there. A lot of paths need to be rewritten for this to really work.
Using pyinstaller to package a py file, it's default behavior is to put all the dependencies in the root folder with the exe file. This is not neat to end users, looks so unneat.
A simple hello.py could end up a mess in the exe folder:
not to mention big projects that use many site-packages modules would end up like.
So I wish there could be a mode, or a flag, to put all the dependency files into one subfolder of the exe folder root.
It is viable, now I can make this by modifying the
spec
file and adding a hook file:This is the
hook.py
:And the packaged folder looks like this, very nice and clean:
Of course, the exe file runs normally, since I have add the
libs
folder to thesys.path
in thehook.py
.I wish this kind of feature could be add to PyInstaller, so users can benifit from this by simply adding an option when using pyinstaller.
The Zen of Python:
The text was updated successfully, but these errors were encountered: