Compiling locales into a Pyinstaller Package?

19 views
Skip to first unread message

TheTechRobo

unread,
May 11, 2020, 3:19:30 AM5/11/20
to PyInstaller
I was compiling a Python script with
pyinstaller --onefile palc.py

and it works perfectly — except when I try to run it it attempts to use the locales stored in the locales directory (meaning it can't find them if I don't distribute the package with the locales directory). As you can imagine, this is a big drawback.

So my main question is: Is there a way that PyInstaller can compile the python script and add the gettext locales in? Thanks! :)

Steve Barnes

unread,
May 11, 2020, 3:26:29 AM5/11/20
to pyins...@googlegroups.com

You can include the locales data in the compiled package with the date file options and then either:

  1. Modify the locales search path before the first use of it or
  2. Have a post install or pre-run script that copies the data to the appropriate location.

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyinstaller...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/f21794ac-bb2c-480e-9ff6-ab8664688e7e%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages