<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<small>Hi All,<br>
<br>
I'm using pyqtdeploy 1.2 on OSX to package my application and so
far have succeeded in getting NumPy and matplotlib to build. I
(and Google!) came up with a method for including modules built as
static objects (.so) by adding them to the Resources directory of
the app bundle and then adding a hook via sys.meta_path to allow
them to be imported outwith the resource system. To clarify, this
means that anything that is a .py file is built into the
application via the Qt resource system and anything that is an .so
file is packaged separately. This has worked fine until I tried it
with SciPy and it's cythonized .so files which throw a SystemError
on import as follows:<br>
<br>
<font face="Courier New, Courier, monospace">...<br>
File ":/scipy/optimize/__init__.py", line 233, in <module><br>
File "bootstrap.py", line 2237, in _find_and_load<br>
File "bootstrap.py", line 2226, in _find_and_load_unlocked<br>
File "bootstrap.py", line 1191, in _load_unlocked<br>
File "bootstrap.py", line 1161, in _load_backward_compatible<br>
File ":/scipy/optimize/_minimize.py", line 26, in
<module><br>
File "bootstrap.py", line 2237, in _find_and_load<br>
File "bootstrap.py", line 2226, in _find_and_load_unlocked<br>
File "bootstrap.py", line 1191, in _load_unlocked<br>
File "bootstrap.py", line 1161, in _load_backward_compatible<br>
File ":/scipy/optimize/_trustregion_dogleg.py", line 5, in
<module><br>
File "bootstrap.py", line 2237, in _find_and_load<br>
File "bootstrap.py", line 2226, in _find_and_load_unlocked<br>
File "bootstrap.py", line 1191, in _load_unlocked<br>
File "bootstrap.py", line 1161, in _load_backward_compatible<br>
File ":/scipy/linalg/__init__.py", line 175, in <module><br>
File "bootstrap.py", line 2237, in _find_and_load<br>
File "bootstrap.py", line 2226, in _find_and_load_unlocked<br>
File "bootstrap.py", line 1191, in _load_unlocked<br>
File "bootstrap.py", line 1161, in _load_backward_compatible<br>
File ":/scipy/linalg/basic.py", line 21, in <module><br>
File "bootstrap.py", line 2237, in _find_and_load<br>
File "bootstrap.py", line 2226, in _find_and_load_unlocked<br>
File "bootstrap.py", line 1191, in _load_unlocked<br>
File "bootstrap.py", line 1161, in _load_backward_compatible<br>
File "__main__.py", line 30, in load_module<br>
File ":/imp.py", line 243, in load_module<br>
File "scipy/linalg/_solve_toeplitz.pyx", line 4, in init
scipy.linalg._solve_toeplitz
(scipy/linalg/_solve_toeplitz.c:19797)<br>
SystemError: Parent module '' not loaded, cannot perform
relative import</font><br>
<br>
The whole 'relative import' bit seems to be a red herring as what
its actually trying to do at that point is import bits of numpy.
I'm guessing this is to do with me moving these .so files outside
of the normal import tree so it cant find things...<br>
<br>
I'm just wondering if Phil or anybody else has had success in
including either SciPy or any other cythonized modules in a
pyqtdeploy project and, if so, how?<br>
<br>
Thanks very much,<br>
Rob<br>
</small>
</body>
</html>