Tryton Py2exe, cx_freeze, pyinstaller? What to use!

901 views
Skip to first unread message

Alexander Davis

unread,
Nov 16, 2016, 12:05:06 PM11/16/16
to tryton
Hello,

First of all i would like to thank the developers for such a great project. I have a question with regards to compiling to a onefile exe...

I am basically editing the sources to produce a simpler Tryton client where the server is automatically selected and all the user would need todo is login with their credentials, that and i edited the png files in the pixmap folders. NOW, when i build and install then run the tryton file in the bin folder via Python 2.7, everything works fine. However, if i use Py2exe to make a onefile and a setup file then things start getting pear-shaped.

The compiling works fine with some warnings about missing modules but the exe produced does not run. It shows up on the task manager for a couple of seconds then it closes. What i also noticed in the modules missing warning is that it is not finding modules that should be already installed!

So i was wondering if there is an official step by step guide to compile the tryton client into a windows executable so i know what i am doing wrong. I found one that was very vague in Spanish and i followed the steps but no results unfortunately.

Would appreciate some support! Thanks!

Alex

Cédric Krier

unread,
Nov 17, 2016, 8:15:04 AM11/17/16
to tryton
The first thing to test is that you can run the client from sources.
After that, if you still have crash when running the client, you must
try with the verbose option to get logs of the error.

--
Cédric Krier - B2CK SPRL
Email/Jabber: cedric...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

Alexander Davis

unread,
Nov 17, 2016, 4:55:04 PM11/17/16
to tryton
Hello,

The client works from the sources. When I run the tryton file in the bin folder (Python tryton) everything works fine. Its just when I use py2exe that the resulting exe file does not work.

This is the error I am getting on py2exe even though it continues afterwards

*** copy extensions ***
*** copy dlls ***
*** copy data files ***
copying C:\Python27\lib\py2exe\run_w.exe -> C:\Users\*****************************\tryton-3.8.8\dist\tryton.exe
The following modules appear to be missing
['Carbon', 'Carbon.Files', 'ElementC14N', '_cairo', '_scproxy', '_speedups', '_sysconfigdata', 'cdecimal', 'dateutil.parser', 'dateutil.relativedelta', 'dateutil.tz', 'gdk', 'glib._glib', 'gobject._gobject', 'goocalendar', 'gtkosx_application', 'gtkspell', 'importlib._bootstrap', 'importlib.reload', 'packaging.specifiers', 'packaging.version', 'resource', 'simplejson._speedups', 'unix', 'urllib.parse', 'win32pipe', 'winreg', 'glib.GError', 'glib.IOChannel', 'glib.IO_ERR', 'glib.IO_FLAG_APPEND', 'glib.IO_FLAG_GET_MASK', 'glib.IO_FLAG_IS_READABLE', 'glib.IO_FLAG_IS_SEEKABLE', 'glib.IO_FLAG_IS_WRITEABLE', 'glib.IO_FLAG_MASK', 'glib.IO_FLAG_NONBLOCK', 'glib.IO_FLAG_SET_MASK', 'glib.IO_HUP', 'glib.IO_IN', 'glib.IO_NVAL', 'glib.IO_OUT', 'glib.IO_PRI', 'glib.IO_STATUS_AGAIN', 'glib.IO_STATUS_EOF', 'glib.IO_STATUS_ERROR', 'glib.IO_STATUS_NORMAL', 'glib.Idle', 'glib.MainContext', 'glib.MainLoop', 'glib.OPTION_ERROR', 'glib.OPTION_ERROR_BAD_VALUE', 'glib.OPTION_ERROR_FAILED', 'glib.OPTION_ERROR_UNKNOWN_OPTION', 'glib.OPTION_FLAG_FILENAME', 'glib.OPTION_FLAG_HIDDEN', 'glib.OPTION_FLAG_IN_MAIN', 'glib.OPTION_FLAG_NOALIAS', 'glib.OPTION_FLAG_NO_ARG', 'glib.OPTION_FLAG_OPTIONAL_ARG', 'glib.OPTION_FLAG_REVERSE', 'glib.OPTION_REMAINING', 'glib.OptionContext', 'glib.OptionGroup', 'glib.PRIORITY_DEFAULT', 'glib.PRIORITY_DEFAULT_IDLE', 'glib.PRIORITY_HIGH', 'glib.PRIORITY_HIGH_IDLE', 'glib.PRIORITY_LOW', 'glib.Pid', 'glib.PollFD', 'glib.SPAWN_CHILD_INHERITS_STDIN', 'glib.SPAWN_DO_NOT_REAP_CHILD', 'glib.SPAWN_FILE_AND_ARGV_ZERO', 'glib.SPAWN_LEAVE_DESCRIPTORS_OPEN', 'glib.SPAWN_SEARCH_PATH', 'glib.SPAWN_STDERR_TO_DEV_NULL', 'glib.SPAWN_STDOUT_TO_DEV_NULL', 'glib.Source', 'glib.Timeout', 'glib.child_watch_add', 'glib.filename_display_basename', 'glib.filename_display_name', 'glib.filename_from_utf8', 'glib.get_application_name', 'glib.get_current_time', 'glib.get_prgname', 'glib.glib_version', 'glib.idle_add', 'glib.io_add_watch', 'glib.main_context_default', 'glib.main_depth', 'glib.markup_escape_text', 'glib.set_application_name', 'glib.set_prgname', 'glib.source_remove', 'glib.spawn_async', 'glib.timeout_add', 'glib.timeout_add_seconds', 'glib.uri_list_extract_uris']
*** binary dependencies ***
Your executable(s) also depend on these dlls which are not included,
you may or may not need to distribute them.
Make sure you have the license if you distribute any of them, and
make sure you don't distribute files belonging to the operating system.
   OLEAUT32.dll - C:\WINDOWS\system32\OLEAUT32.dll
   USER32.dll - C:\WINDOWS\system32\USER32.dll
   COMCTL32.DLL - C:\WINDOWS\system32\COMCTL32.DLL
   SHELL32.DLL - C:\WINDOWS\system32\SHELL32.DLL
   OLE32.dll - C:\WINDOWS\system32\OLE32.dll
   SHLWAPI.DLL - C:\WINDOWS\system32\SHLWAPI.DLL
   COMDLG32.DLL - C:\WINDOWS\system32\COMDLG32.DLL
   ADVAPI32.DLL - C:\WINDOWS\system32\ADVAPI32.DLL
   msvcrt.dll - C:\WINDOWS\system32\msvcrt.dll
   WS2_32.dll - C:\WINDOWS\system32\WS2_32.dll
   WINSPOOL.DRV - C:\WINDOWS\system32\WINSPOOL.DRV
   GDI32.dll - C:\WINDOWS\system32\GDI32.dll
   IMM32.DLL - C:\WINDOWS\system32\IMM32.DLL
   libxml2-2.dll - C:\Python27\lib\site-packages\gtk-2.0\runtime\bin\libxml2-2.dll
   KERNEL32.dll - C:\WINDOWS\system32\KERNEL32.dll
   gdiplus.dll - C:\WINDOWS\system32\gdiplus.dll

I have Python 27, py2exe, & pygtk all in one

Alex

Cédric Krier

unread,
Nov 17, 2016, 7:05:03 PM11/17/16
to tryton
On 2016-11-17 13:07, Alexander Davis wrote:
> Hello,
>
> The client works from the sources. When I run the tryton file in the bin
> folder (Python tryton) everything works fine. Its just when I use py2exe
> that the resulting exe file does not work.
>
> This is the error I am getting on py2exe even though it continues afterwards

There is no error there.

Please follow my advise an start the client in verbose mode.

> > After that, if you still have crash when running the client, you must
> > try with the verbose option to get logs of the error.


PS: Please do not top-post on this mailing list, see
https://groups.tryton.org/netiquette

Alexander Davis

unread,
Nov 18, 2016, 4:20:04 AM11/18/16
to tryton
Hello,

Sorry about that...

I thought so too but when i run the resulting onefile exe and setup from py2exe, the client does not run, so i gathered that it had something to do with the modules missing part. I will check and let you know. Thanks Cedric.

Alex

Alexander Davis

unread,
Nov 18, 2016, 4:40:04 AM11/18/16
to tryton


On Friday, November 18, 2016 at 1:05:03 AM UTC+1, Cédric Krier wrote:
I ran the client in the dist folder and got this error after following your advice

Traceback (most recent call last):
  File "tryton", line 45, in <module>
  File "tryton\client.pyc", line 24, in <module>
  File "tryton\common\__init__.pyc", line 3, in <module>
  File "tryton\common\common.pyc", line 16, in <module>
  File "tryton\config.pyc", line 12, in <module>
  File "pkg_resources\__init__.pyc", line 70, in <module>
  File "pkg_resources\extern\__init__.pyc", line 61, in load_module
ImportError: The 'appdirs' package is required; normally this is bundled with this package so if you get this warning, consult the packager of your distribution.

This is something i can work with and troubleshoot. Better than nothing!

Thanks again! Good thing i asked for directions eh!

Cédric Krier

unread,
Nov 18, 2016, 4:55:04 AM11/18/16
to tryton
On 2016-11-18 01:23, Alexander Davis wrote:
> I ran the client in the dist folder and got this error after following your
> advice
>
> Traceback (most recent call last):
> File "tryton", line 45, in <module>
> File "tryton\client.pyc", line 24, in <module>
> File "tryton\common\__init__.pyc", line 3, in <module>
> File "tryton\common\common.pyc", line 16, in <module>
> File "tryton\config.pyc", line 12, in <module>
> File "pkg_resources\__init__.pyc", line 70, in <module>
> File "pkg_resources\extern\__init__.pyc", line 61, in load_module
> ImportError: The 'appdirs' package is required; normally this is bundled
> with this package so if you get this warning, consult the packager of your
> distribution.
>
> This is something i can work with and troubleshoot. Better than nothing!
>
> Thanks again! Good thing i asked for directions eh!

This was fixed by https://bugs.tryton.org/issue5739

Alexander Davis

unread,
Nov 18, 2016, 5:55:05 AM11/18/16
to tryton
THANK YOU! I applied the fixes to the config and translation files and it is now compiling perfectly! I was using 3.8.8 so i am guessing this was fixed in the new builds

Dominique Chabord

unread,
Nov 18, 2016, 9:37:41 AM11/18/16
to try...@googlegroups.com
hi,
back to the functionnality, it would bwould what you did be of any
interest for others ?
regards
Message has been deleted

Alexander Davis

unread,
Nov 19, 2016, 5:55:04 AM11/19/16
to tryton, dominiqu...@sisalp.org
The functionality part i am still working on and i am actually going to post another topic about it! 
Reply all
Reply to author
Forward
0 new messages