Reputation: 1268
I have an application in which I added a module that plots data using vispy
and scipy
(for Delaunay).
It works fine when I run within the Python (3.4 x64 on Windows) interpreter, but not when frozen using cx_freeze
. It does not give me any error message, simply it does not run (quietly).
Here my cx_freeze
script:
buildOptions = dict(packages = ['osgeo._gdal', 'scipy.sparse.csgraph._validation'])
import sys
base = 'Win32GUI' if sys.platform=='win32' else None
executables = [
Executable('main.py', base=base, targetName = 'myApp.exe', icon='ico/myApp.ico')
]
setup(name='MyApp',
version = '0.0.1',
description = 'My fancy app',
author = '[email protected]',
options = dict(build_exe = buildOptions),
executables = executables)
I have to add 'scipy.sparse.csgraph._validation'
to fix a previous missing inclusion as suggested here: scipy with py2exe and here
Looking for DLL issues, I have already attempted with Dependency Walker but without luck.
If I comment out the module with the vispy
plot, everything works fine. Any hint?
Upvotes: 2
Views: 542
Reputation: 5076
We've not thought about freezing apps with Vispy much yet. The pitfall that I'd expect matches with gmas80's answer; Vispy can use multiple backends, which means that these are dynamically loaded and cx_Freeze is unable to select the backend modules as a dependency. Depending on the backend that you need, you need to add some modules in vispy.backends
to the list of includes.
Upvotes: 1
Reputation: 1268
I have attempted to freeze just the module with the problem by adding a main
with a QApplication
that display the QWigdet
with the vispy.app.canvas
. This helped because I got a very useful backtrace error related to vispy.app.backends._pyside
.
After explicitly adding this to my posted cx_freeze
script, the frozen application works:
packages = ['osgeo._gdal', 'vispy.app.backends._pyside', 'scipy.sparse.csgraph._validation']
The difference that I found in the build directory is the presence of QtOpenGL4.dll
and PySide.QtOpenGL.pyd
. They were not there without the explicit package inclusion (my application was already using PySide).
Upvotes: 2