Il giorno sab, 13/02/2010 alle 18.09 -0800, Jay ha scritto:
> Hello,
>
> I'm trying to build a small python program, that uses PyQwt, but I get
> an ImportError and a SyntaxError. Do I have to change the
> \PyQt4\Qwt5\__init__.py? I found, that hook-PyQt4.Qwt5.py is empty -
> in my installation and in the current snapshot as well. Any
> suggestions?
That file is supposed to be empty. It is required only because a quirk
in the way PyInstaller processes import hooks. It's not related to your
problem.
> Here is the complete output:
>
> C:\Users\Jay\Documents\Prog\>C:\Develop\PyInstaller\Build.py C:\Users
> \Jay\Documents\Prog\Prog.spec
> checking Analysis
> building Analysis because outAnalysis0.toc non existent
> running Analysis outAnalysis0.toc
> Analyzing: C:\Develop\PyInstaller\support\_mountzlib.py
> Analyzing: C:\Develop\PyInstaller\support\useUnicode.py
> Analyzing: C:\Users\Jay\Documents\Prog\Prog.pyw
> Traceback (most recent call last):
> File "<string>", line 1, in <module>
> File "C:\Develop\Python\lib\site-packages\PyQt4\Qwt5\__init__.py",
> line 32
> , in <module>
> from Qwt import *
> ImportError: DLL load failed: The specified procedure could not be
> found.
> Traceback (most recent call last):
> File "C:\Develop\PyInstaller\Build.py", line 1158, in <module>
> main(args[0], configfilename=opts.configfile)
> File "C:\Develop\PyInstaller\Build.py", line 1146, in main
> build(specfile)
> File "C:\Develop\PyInstaller\Build.py", line 1109, in build
> execfile(spec)
> File "C:\Users\Jay\Documents\Prog\Prog.spec", line 3, in <module>
> pathex=['C:\\Users\\Jay\Documents\Prog'])
> File "C:\Develop\PyInstaller\Build.py", line 245, in __init__
> self.__postinit__()
> File "C:\Develop\PyInstaller\Build.py", line 196, in __postinit__
> self.assemble()
> File "C:\Develop\PyInstaller\Build.py", line 314, in assemble
> analyzer.analyze_script(script)
> File "C:\Develop\PyInstaller\mf.py", line 566, in analyze_script
> return self.analyze_r('__main__')
> File "C:\Develop\PyInstaller\mf.py", line 460, in analyze_r
> newnms = self.analyze_one(name, nm, imptyp, level)
> File "C:\Develop\PyInstaller\mf.py", line 519, in analyze_one
> mod = self.doimport(nm, ctx, fqname)
> File "C:\Develop\PyInstaller\mf.py", line 668, in doimport
> hooks = __import__('hooks', globals(), locals(), [hookmodnm])
> File "C:\Develop\PyInstaller\hooks\hook-PyQt4.Qwt5.py", line 5, in
> <module
> >
> if hookutils.qwt_numpy_support():
> File "C:\Develop\PyInstaller\hooks\hookutils.py", line 53, in
> qwt_numpy_su
> pport
> return eval(exec_statement("from PyQt4 import Qwt5; print
> hasattr(Qwt5, 'toN
> umpy')"))
> File "<string>", line 0
>
> ^
> SyntaxError: unexpected EOF while parsing
Have a look at exec_statement(). The function is supposed to spawn a
python interpreter, execute the statement that you see between quotes,
redirect the stdout to a temporary file and read it from there. It
doesn't use subprocess for backward compatibility.
For some reason, that function doesn't work for you. You should try
debugging it by adding some prints and see what happens.
Do you use the standard CMD shell?
Can you also try this patch to see if it helps?
Index: hooks/hookutils.py
===================================================================
--- hooks/hookutils.py (revision 770)
+++ hooks/hookutils.py (working copy)
@@ -14,7 +14,7 @@
# Using "echo on" as a workaround for a bug in NT4 shell
if os.name == "nt":
- cmd = '"echo on && "%s" -c "%s" > "%s""' % (exe, stat, fnm)
+ cmd = 'echo on && "%s" -c "%s" > "%s"' % (exe, stat, fnm)
else:
cmd = '"%s" -c "%s" > "%s"' % (exe, stat, fnm)
os.system(cmd)
--
Giovanni Bajo
Develer S.r.l.
http://www.develer.com
--
You received this message because you are subscribed to the Google Groups
"PyInstaller" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/pyinstaller?hl=en.