[PyQt] Which version of Python does dip REALLY work with?
Phil Thompson
phil at riverbankcomputing.com
Thu Jul 29 22:29:24 BST 2010
On Fri, 30 Jul 2010 07:13:06 +1000, Peter Milliken
<peter.milliken at gmail.com> wrote:
> Hi,
>
> I have Mark Summerfield's book on Rapid gui development with Python and
Qt
> and followed the link in Appendix A and found "dip".
>
> I have Python 2.6.2. The web-site states it works with 2.6, 2.7 and 3.x,
I
> realise it is 0.1 and is bound to have problems, but...
>
> First problem after installation was that the "shebang" doesn't work
with
> cygwin bash and Windows XP i.e. when you just run dip-builder it returns
a
> complaint of "no such file" for /c/Python26/Scripts/dip-builder - Python
> doesn't understand bash paths.
>
> Next problem (after explicitly running dip-builder in the Scripts
> directory)
> was the final line:
>
> wres12386#1(/c/Python26/Scripts)$ python dip-builder
> File "dip-builder", line 93
> sys.exit(app.exec())
> ^
> SyntaxError: invalid syntax
> [exited with 1]
>
> A quick look at the Qt documentation for QApplication shows it should be
> app.exec_()
>
> So that script can't work with ANY version of Python :-)
>
> Fixed that, then it complained with:
>
> wres12386#1(/c/Python26/Scripts)$ python dip-builder
> Traceback (most recent call last):
> File "dip-builder", line 28, in <module>
> from dip.plugins import PluginManager
> File "c:\Python26\lib\site-packages\dip\plugins\__init__.py", line 21,
in
> <module>
> from .i_extension_point import IExtensionPoint
> File "c:\Python26\lib\site-packages\dip\plugins\i_extension_point.py",
> line 16, in <module>
> from dip.model import Interface, List, Str
> File "c:\Python26\lib\site-packages\dip\model\__init__.py", line 45,
in
> <module>
> from .adapt import adapt
> File "c:\Python26\lib\site-packages\dip\model\adapt.py", line 21
> def adapt(*adapted, to):
> ^
> SyntaxError: invalid syntax
> [exited with 1]
>
> Not sure what this error is - haven't investigated it, thought it might
be
> advisable to re-check the versions of Python it is supposed to work
with. I
> realise I don't have the latest 2.6.x, but I thought before I go to a
lot
> of
> trouble downloading other versions of Python (I do not want to go to 3.x
-
> I
> need to stay with 2.x), I thought I would ask the question:
>
> Exactly what version of Python has anybody ACTUALLY got the dip
> distribution
> working with? :-)
>
> In the meantime, I think I'll just go back to reading the book...
So what version of dip are you using?
dip v0.1 is Python v3 only. For earlier versions of Python you need a
current snapshot. Hint: pick the one with "py2" in the package name.
Phil
More information about the PyQt
mailing list