Discussion:
[Eric] Recipe for parallel installation of PyQt5 and PyQt4 on Windows
Detlev Offenbach
2014-01-18 14:54:46 UTC
Permalink
Hello,

here is a short info about how I got a parallel installation of PyQt4/Qt4 and PyQt5/Qt5 for Python3
on Windows using the installers provided via the PyQt site.

1) Download both installers.
2) Install PyQt4
3) recommended: Install eric5 and verify, that eric5/PyQt4/Qt4 work ok.
4) Open an explorer window, move to the site-packages directory (e.g. C:\Python33\Lib\site-
packages)
5) Make a copy of the PyQt4 directory
6) Uninstall PyQt4 so the PyQt5 installer doesn't complain later on.
7) Install PyQt5
8) Rename the copy of the PyQt4 directory to 'PyQt4'
9) Voila.

My preliminary tests using the eric5 QRegularExpression wizard, which invokes a background
process using PyQt5, worked fine.

If further tests of the community don't show severe issues, I would like to ask Phil to generate an
installer including both PyQt4/Qt4 and PyQt5/Qt5 to make it easier for the community. It seems
that most people on Windows don't like to compile something.

Regards,
Detlev--
*Detlev Offenbach*
detlev at die-offenbachs.de
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/eric/attachments/20140118/f6cddef3/attachment.html>
Phil Thompson
2014-01-18 16:47:16 UTC
Permalink
Post by Detlev Offenbach
Hello,
here is a short info about how I got a parallel installation of
PyQt4/Qt4 and PyQt5/Qt5 for Python3 on Windows using the installers
provided via the PyQt site.
1) Download both installers.
2) Install PyQt4
3) recommended: Install eric5 and verify, that eric5/PyQt4/Qt4 work ok.
4) Open an explorer window, move to the site-packages directory (e.g.
C:Python33Libsite-packages)
5) Make a copy of the PyQt4 directory
6) Uninstall PyQt4 so the PyQt5 installer doesn't complain later on.
7) Install PyQt5
8) Rename the copy of the PyQt4 directory to 'PyQt4'
9) Voila.
My preliminary tests using the eric5 QRegularExpression wizard, which
invokes a background process using PyQt5, worked fine.
If further tests of the community don't show severe issues, I would
like to ask Phil to generate an installer including both PyQt4/Qt4
and
PyQt5/Qt5 to make it easier for the community. It seems that most
people on Windows don't like to compile something.
I don't see how that can work. There can only be one qt.conf file and
it can refer to either the Qt4 libs or the Qt5 libs, but not both.

Phil
Detlev Offenbach
2014-01-18 17:01:18 UTC
Permalink
Post by Phil Thompson
Post by Detlev Offenbach
Hello,
here is a short info about how I got a parallel installation of
PyQt4/Qt4 and PyQt5/Qt5 for Python3 on Windows using the installers
provided via the PyQt site.
1) Download both installers.
2) Install PyQt4
3) recommended: Install eric5 and verify, that eric5/PyQt4/Qt4 work ok.
4) Open an explorer window, move to the site-packages directory (e.g.
C:Python33Libsite-packages)
5) Make a copy of the PyQt4 directory
6) Uninstall PyQt4 so the PyQt5 installer doesn't complain later on.
7) Install PyQt5
8) Rename the copy of the PyQt4 directory to 'PyQt4'
9) Voila.
My preliminary tests using the eric5 QRegularExpression wizard, which
invokes a background process using PyQt5, worked fine.
If further tests of the community don't show severe issues, I would
like to ask Phil to generate an installer including both PyQt4/Qt4
and
PyQt5/Qt5 to make it easier for the community. It seems that most
people on Windows don't like to compile something.
I don't see how that can work. There can only be one qt.conf file and
it can refer to either the Qt4 libs or the Qt5 libs, but not both.
That is right. However, the qt.conf file is in PyQt4 and PyQt5 directory and each contains the
paths to the Qt librarys (that is one contains PyQt4, the other PyQt5). Works fine on my
maschine.

Phil, please just try it. If you find issues that crash one or the other installation, I will shut up and
never mention this again. However, at the moment I am not convinced that there is a show
stopper.

This is the contents of my qt.conf of PyQt4:
[Paths]
Prefix = C:/Python33/Lib/site-packages/PyQt4
Binaries = C:/Python33/Lib/site-packages/PyQt4

That is the on of the PyQt5 qt.conf:
[Paths]
Prefix = C:/Python33/Lib/site-packages/PyQt5
Binaries = C:/Python33/Lib/site-packages/PyQt5

And there is a third qt.conf file in the Python directory with the contents of the last install (i.e.
PyQt5). I got the impression, that the one in the PyQt[45] directories have precedence over the
global one.


Detlev--
*Detlev Offenbach*
detlev at die-offenbachs.de
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/eric/attachments/20140118/b0b7700a/attachment.html>
Hans Schmidt
2014-01-18 17:10:10 UTC
Permalink
Hello,

I tried to do this, but it does not work (at least not as in the
tutorial). I started from my already existing PyQt4 installation and
then proceeded with steps 4 to 8.

When trying to open eric5.bat, it does not do anything.
When I open a Python interpreter and try to import QtGui, it gives me
the following:

Python 3.3.2 (v3.3.2:d047928ae3f6, May 16 2013, 00:03:43) [MSC v.1600 32
bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more
information.
Post by Detlev Offenbach
from PyQt4 import
QtGui
Traceback (most recent call
last):
File "<stdin>", line 1, in
<module>
ImportError: DLL load failed: %1 ist keine zul?ssige
Win32-Anwendung.
Post by Detlev Offenbach
from PyQt5 import
QtGui
Traceback (most recent call
last):
File "<stdin>", line 1, in
<module>
ImportError: DLL load failed: %1 ist keine zul?ssige
Win32-Anwendung.
Post by Detlev Offenbach
That is right. However, the qt.conf file is in PyQt4 and PyQt5
directory and each contains the paths to the Qt librarys (that is one
contains PyQt4, the other PyQt5). Works fine on my maschine.
Phil, please just try it. If you find issues that crash one or the
other installation, I will shut up and never mention this again.
However, at the moment I am not convinced that there is a show stopper.
Detlev Offenbach
2014-01-18 17:20:31 UTC
Permalink
Post by Detlev Offenbach
Hello,
I tried to do this, but it does not work (at least not as in the
tutorial). I started from my already existing PyQt4 installation and
then proceeded with steps 4 to 8.
When trying to open eric5.bat, it does not do anything.
When I open a Python interpreter and try to import QtGui, it gives me
Python 3.3.2 (v3.3.2:d047928ae3f6, May 16 2013, 00:03:43) [MSC v.1600 32
bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more
information.
Post by Detlev Offenbach
from PyQt4 import
QtGui
Traceback (most recent call
File "<stdin>", line 1, in
<module>
ImportError: DLL load failed: %1 ist keine zul?ssige
Win32-Anwendung.
Post by Detlev Offenbach
from PyQt5 import
QtGui
Traceback (most recent call
File "<stdin>", line 1, in
<module>
ImportError: DLL load failed: %1 ist keine zul?ssige
Win32-Anwendung.
That is strange. Everything works on my computer over here; eric5 ok, the above given PyQt4
import ok and the PyQt5 import executed in a second Python command window ok. Importing
both in the same interpreter fails as expected.
Post by Detlev Offenbach
Post by Detlev Offenbach
That is right. However, the qt.conf file is in PyQt4 and PyQt5
directory and each contains the paths to the Qt librarys (that is one
contains PyQt4, the other PyQt5). Works fine on my maschine.
Phil, please just try it. If you find issues that crash one or the
other installation, I will shut up and never mention this again.
However, at the moment I am not convinced that there is a show stopper.
_______________________________________________
Eric mailing list
Eric at riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/eric--
*Detlev Offenbach*
detlev at die-offenbachs.de
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/eric/attachments/20140118/f022210b/attachment.html>
Loading...