[PyQt] Detecting which Python version is used by SIP and PyQt

Xavion xavion.0 at gmail.com
Sun Oct 24 01:18:20 BST 2010


I must also leap to the defence of Arch Linux, which I've happily used for
about four years.  In calling itself a "bleeding-edge" distribution, it must
be willing to upgrade major packages promptly.  I think the onus is now on
other distributions to ensure that the 'python2' and 'python3'
symbolic-links are part of their respective Python packages.

The maintainer of the 'sip' and 'pyqt' packages on Arch Linux has accepted my
request <https://bugs.archlinux.org/task/21422> to upgrade these to use
Python v3.  As you can see from my second comment, I had no difficulty
getting SIP and PyQt working with Python v3.  Let's just hope that the
maintainer gets his shit together and does the same for the benefit of other
end-users.

Thanks for taking the time to write that code for me, Hans-Peter.  For the
moment, I've decided to lock-down users of my applications to Python v2.
After running '2to3' on some of my source files, it was obvious that more
work needs to be done.  In order to keep my Makefiles relatively
uncomplicated, I've decided to use the following code:
...
Python2 = $(shell which python2 2> /dev/null)
Python2-Ver = $(word 2,$(shell $(Python2) --version 2>&1))
...
$(if $(shell $(Python2) -c "import PyQt4" 2>&1 | grep "No module named
PyQt4"),$(error Error: The required 'PyQt4' module can't be found; ensure
it's importable by 'Python2' before building),)
...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20101024/43b02092/attachment.html>


More information about the PyQt mailing list