Package Base Details: pyqt4

Git Clone URL: (read-only, click to copy)
Submitter: arojas
Maintainer: LaughingMan
Last Packager: LaughingMan
Votes: 20
Popularity: 1.01
First Submitted: 2018-08-24 08:49
Last Updated: 2021-01-25 01:26

Latest Comments

« First ‹ Previous 1 2 3 4 5 6 7 8 Next › Last »

maximaman commented on 2020-05-09 21:13

The creation of the package fails during the build() stage with the following error: Error: PyQt4 cannot be built with sip v5 (or later)..

I managed to fix the error by replacing all invocations of with invocations of (Check out the diff at the end of the comment for more info.)

After fixing the aforementioned error, I experienced another one (again during the build() stage):

Traceback (most recent call last):
  File "", line 27, in <module>
    import sipconfig
ImportError: No module named sipconfig

This traceback turned out to be from an invocation of using python2, so I checked whether I had python2-sip installed, and I did not (as I expected). Naturally, installing that package solved the problem for me. (I suppose that it is also necessary to have python-sip installed so that the invocation of using python3 would succeed as well.)

After that, I experienced another error during the package_pyqt4-common() phase:

make: Entering directory '/home/sid/.cache/yay/pyqt4/src/PyQt4_gpl_x11-4.12.3/pyrcc'
cp -f pyrcc4 /usr/bin/pyrcc4
cp: cannot create regular file '/usr/bin/pyrcc4': Permission denied
make: *** [Makefile:41: install] Error 1
make: Leaving directory '/home/sid/.cache/yay/pyqt4/src/PyQt4_gpl_x11-4.12.3/pyrcc'

It turned out that the error is caused by the make install not being properly invoked for the pyrcc subdirectory by the package_pyqt4-common() function: the value of the DESTDIR variable is not assigned, so the install target for the pyrcc subdirectory would attempt to copy a file into the real root instead of the fake one (which causes the permission error). I was able to fix the problem and (finally!) successfully build the package by changing the invocations of make install for pyrcc and pylupdate to have DESTDIR set to the fakeroot.

Here is a diff containing all of my modifications to the tip of the master branch:

diff --git a/PKGBUILD b/PKGBUILD
index d25a0ca..a82f094 100644
@@ -23,7 +23,7 @@ prepare() {

 build() {
   cd PyQt4_gpl_x11-${pkgver}
-  python \
+  python \
     --confirm-license \
     --no-sip-files \
     --qsci-api \
@@ -35,7 +35,7 @@ build() {

   ### Python2 version ###
   cd ../PyQt4_gpl_x11-${pkgver}-py2
-  python2 \
+  python2 \
     --confirm-license \
     --no-sip-files \
     --qsci-api \
@@ -54,8 +54,8 @@ package_pyqt4-common() {

   cd PyQt4_gpl_x11-${pkgver}
-  make -C pyrcc INSTALL_ROOT="${pkgdir}" install
-  make -C pylupdate INSTALL_ROOT="${pkgdir}" install
+  make -C pyrcc INSTALL_ROOT="${pkgdir}" DESTDIR="${pkgdir}" install
+  make -C pylupdate INSTALL_ROOT="${pkgdir}" DESTDIR="${pkgdir}" install

   install -Dm644 PyQt4.api "${pkgdir}"/usr/share/qt4/qsci/api/python/PyQt4.api

malibu commented on 2020-05-02 16:50

Hi there, I am getting an invalid key error installing phonon with the default trizen install for python-pyqt4:

phonon-4.10.2.tar.xz ... FAILED (unknown public key B92A5F04EC949121).

I have read that phonon is deprecated and should be removed. so I am happy to read that phonon is optional for this package; can anyone tell me how to skip it so that I can install pyqt4 which I need for hp-setup in order to get my printer to work?

buzo commented on 2019-11-25 20:55

Build is fixed now, thanks omgold!

PedroHLC commented on 2019-11-17 22:27

I can't build this with Python 3.8, anyone knows how?

yoarch commented on 2019-11-13 15:11

Solved it by creating the patch cc.patch mentioned by omgold. Puting it in the src folder and adding these 2 lines in the prepare function of the PKGBUILD:

patch -i cc.patch PyQt4_gpl_x11-${pkgver}/
patch -i cc.patch PyQt4_gpl_x11-${pkgver}-py2/

Restart the compilation.

omgold commented on 2019-11-04 11:43

Got the same problem as JohnRobson:

/usr/bin/sip -w -n PyQt4.sip -f -n PyQt4.sip -t WS_X11 -t Qt_4_8_7 -B Qt_5_0_0 -o -P -a QtCore.api -y QtCore.pyi -g -c /home/omgold/tmp/pyqt4/src/PyQt4_gpl_x11-4.12.3/QtCore -I sip -I /home/omgold/tmp/pyqt4/src/PyQt4_gpl_x11-4.12.3/sip /home/omgold/tmp/pyqt4/src/PyQt4_gpl_x11-4.12.3/sip/QtCore/QtCoremod.sip
sip: Deprecation warning: the -B flag is deprecated
Error: Unable to create the C++ code.

The issue is the '-f' flag in combination with the deprecation warning (which -f turns into an error). Unfortunately it is hardcoded in the configure script. Patching it like this, helps for me:

---        2019-11-04 12:26:04.113841273 +0100
+++     2019-11-04 12:27:12.965701104 +0100
@@ -2217,7 +2217,7 @@

     # Build the SIP command line.
-    argv = [quote(target_config.sip), '-w', '-n', 'PyQt4.sip', '-f', sip_flags]
+    argv = [quote(target_config.sip), '-w', '-n', 'PyQt4.sip', sip_flags]

     # Make sure any unknown Qt version gets treated as the latest Qt v4.

JohnRobson commented on 2019-10-28 00:43

The interpreter used by pyuic4 is /usr/bin/python.
Generating the C++ source for the QtCore module...
Error: Unable to create the C++ code.
==> ERROR: A failure occurred in build().
Error making: pyqt4 (pyqt4-common)

Attius_Sullivan commented on 2019-10-16 08:46

Actually, since the day before yesterday (14th of October 2019) the "sip"-Package got flagged outdated. Does it make sense to install the 4.19.16-2 version of "sip" or have we to accept that this isn't working now. What do you think?

Skalli84 commented on 2019-10-08 00:48

@esdrasedu: Thanks, it helped me too. For noobs like me, to get the package you can download it from here: I followed the advice and tried it with 4.19.16-1 (couldn't find the 2). sip-4.19.16-1-x86_64.pkg.tar.xz Downgraded with sudo pacman -U ~/Downloads/sip-4.19.16-1-x86_64.pkg.tar.xz. Might work with sudo pacman -U too but haven't tried.

Neff commented on 2019-10-05 07:04

esdrasedu thank you very much,very useful!