FS#54508 - [python-qtpy] Missing dependency?

Attached to Project: Community Packages
Opened by Stefano (senden9) - Sunday, 18 June 2017, 16:43 GMT
Last edited by Muflone (muflone) - Sunday, 09 July 2017, 17:06 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Muflone (muflone)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
If I try to start spyder I get an error because the missing module "PyQt4.QtWebKit".

Package version:
$ LANG=C pacman -Qi spyder3
Name : spyder3
Version : 3.1.4-1
Description : Scientific PYthon Development EnviRonment providing MATLAB-like features for Python 3.x series.
Architecture : any
URL : https://github.com/spyder-ide/spyder/
Licenses : MIT
Groups : None
Provides : None
Depends On : python-pyqt5 qt5-webkit python-qtconsole python-qtpy python-qtawesome python-pyflakes python-pyzmq python-pygments
python-psutil python-pickleshare jupyter jupyter-nbconvert python-rope python-jedi python-pylint python-pycodestyle
python-sphinx icu gtk-update-icon-cache
Optional Deps : python-numpy: N-dimensional arrays [installed]
python-scipy: signal/image processing [installed]
python-h5py: HDF5 support
python-matplotlib: interactive 2D/3D data plotting [installed]
python-sympy: symbolic mathematics for the IPython console [installed]
python-pandas: view and edit DataFrames and Series in the Variable Explorer [installed]
Required By : None
Optional For : None
Conflicts With : None
Replaces : None
Installed Size : 12.33 MiB
Packager : Fabio Castelli (Muflone) <muflone@archlinux.org>
Build Date : Sun 07 May 2017 02:53:35 AM CEST
Install Date : Sun 18 Jun 2017 06:37:16 PM CEST
Install Reason : Explicitly installed
Install Script : No
Validated By : Signature

Error Message:
$ /usr/bin/spyder3
Traceback (most recent call last):
File "/usr/bin/spyder3", line 3, in <module>
start.main()
File "/usr/lib/python3.6/site-packages/spyder/app/start.py", line 103, in main
from spyder.app import mainwindow
File "/usr/lib/python3.6/site-packages/spyder/app/mainwindow.py", line 92, in <module>
from qtpy import QtWebEngineWidgets # analysis:ignore
File "/usr/lib/python3.6/site-packages/qtpy/QtWebEngineWidgets.py", line 31, in <module>
from PyQt4.QtWebKit import QWebPage as QWebEnginePage
ModuleNotFoundError: No module named 'PyQt4.QtWebKit'
This task depends upon

Closed by  Muflone (muflone)
Sunday, 09 July 2017, 17:06 GMT
Reason for closing:  Fixed
Additional comments about closing:  spyder 3.1.4-2
Now spyder and spyder3 force the use of pyqt5 during the startup
Comment by Muflone (muflone) - Monday, 03 July 2017, 20:32 GMT
I'm unable to track the source of your issue.
Can you please post the result of
LANG=C pacman -Qs webkit
?
Comment by Doug Newgard (Scimmia) - Monday, 03 July 2017, 21:58 GMT
The source is easy. QtWebKit bindings have been disabled in pyqt4 (https://git.archlinux.org/svntogit/packages.git/commit/trunk?h=packages/pyqt4&id=8cbe3c19635ab35860a5c479c3a93e8994c2a811), but /usr/lib/python3.6/site-packages/qtpy/QtWebEngineWidgets.py from this package requires them.
Comment by Muflone (muflone) - Monday, 03 July 2017, 23:20 GMT
python-qtpy doesn't require at the same time both PyQT4, PyQT5 and PySide, just only one of them.

As spyder has python-pyqt5 and qt5-webkit dependencies, python-qtpy should import QtWebEngineWidgets using PYQT5.
I cannot find any reference to PYQT4 in spyder package.
Comment by Stefano (senden9) - Tuesday, 04 July 2017, 06:02 GMT
$ LANG=C pacman -Qs webkit
local/epiphany 3.24.2-1 (gnome)
A GNOME web browser based on the WebKit rendering engine
local/qt5-webkit 5.212.0alpha2-2 (qt qt5)
Classes for a WebKit2 based implementation and a new QML API
local/webkit2gtk 2.16.5-1
GTK+ Web content engine library

$ LANG=C pacman -Qi python-qtpy
Name : python-qtpy
Version : 1.2.1-1
Description : Provides an uniform layer to support PyQt5, PyQt4 and PySide with a single codebase
Architecture : any
URL : https://github.com/spyder-ide/python-qtpy/
Licenses : MIT
Groups : None
Provides : None
Depends On : python
Optional Deps : python-pyqt4: Qt4 Python bindings [installed]
python-pyqt5: Qt5 Python bindings [installed]
python-pyside: PySide Qt4 Python bindings
Required By : spyder3
Optional For : None
Conflicts With : None
Replaces : None
Installed Size : 182.00 KiB
Packager : Fabio Castelli (Muflone) <muflone@archlinux.org>
Build Date : Mon 23 Jan 2017 12:30:23 AM CET
Install Date : Sun 18 Jun 2017 06:37:15 PM CEST
Install Reason : Installed as a dependency for another package
Install Script : No
Validated By : Signature
Comment by mentatf (mentatf) - Wednesday, 05 July 2017, 07:42 GMT
Same issue here, I removed and purged the package several times but to no effect.

$ LANG=C pacman -Qs webkit
local/qt5-webkit 5.212.0alpha2-2 (qt qt5)
Classes for a WebKit2 based implementation and a new QML API
local/webkit2gtk 2.16.5-1
GTK+ Web content engine library
local/webkitgtk 2.4.11-6
Legacy Web content engine for GTK+ 3

$ LANG=C pacman -Qi python-qtpyName : python-qtpy
Version : 1.2.1-1
Description : Provides an uniform layer to support PyQt5, PyQt4 and PySide with a single codebase
Architecture : any
URL : https://github.com/spyder-ide/python-qtpy/
Licenses : MIT
Groups : None
Provides : None
Depends On : python
Optional Deps : python-pyqt4: Qt4 Python bindings [installed]
python-pyqt5: Qt5 Python bindings [installed]
python-pyside: PySide Qt4 Python bindings [installed]
Required By : spyder3
Optional For : None
Conflicts With : None
Replaces : None
Installed Size : 182.00 KiB
Packager : Fabio Castelli (Muflone) <muflone@archlinux.org>
Build Date : Mon Jan 23 00:30:23 2017
Install Date : Sun Jan 29 14:08:14 2017
Install Reason : Installed as a dependency for another package
Install Script : No
Validated By : Signature
Comment by Muflone (muflone) - Wednesday, 05 July 2017, 21:46 GMT
Could you please test the qtpy package with the following command

python -c "import qtpy; print('\n'.join(['%s = %s' % (m, getattr(qtpy, m)) for m in dir(qtpy) if m not in ('__doc__', '__builtins__')]))"

and copy the results here?
Comment by Stefano (senden9) - Thursday, 06 July 2017, 07:29 GMT
Sure:

$ python -c "import qtpy; print('\n'.join(['%s = %s' % (m, getattr(qtpy, m)) for m in dir(qtpy) if m not in ('__doc__', '__builtins__')]))"
API = pyqt5
API_NAME = PyQt5
PYQT4 = False
PYQT4_API = ['pyqt', 'pyqt4']
PYQT5 = True
PYQT5_API = ['pyqt5']
PYQT_VERSION = 5.8.2
PYSIDE = False
PYSIDE_API = ['pyside']
PYSIDE_VERSION = None
PythonQtError = <class 'qtpy.PythonQtError'>
QT_API = QT_API
QT_VERSION = 5.9.1
__cached__ = /usr/lib/python3.6/site-packages/qtpy/__pycache__/__init__.cpython-36.pyc
__file__ = /usr/lib/python3.6/site-packages/qtpy/__init__.py
__loader__ = <_frozen_importlib_external.SourceFileLoader object at 0x7f0fe35e1780>
__name__ = qtpy
__package__ = qtpy
__path__ = ['/usr/lib/python3.6/site-packages/qtpy']
__spec__ = ModuleSpec(name='qtpy', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7f0fe35e1780>, origin='/usr/lib/python3.6/site-packages/qtpy/__init__.py', submodule_search_locations=['/usr/lib/python3.6/site-packages/qtpy'])
__version__ = 1.2.1
_version = <module 'qtpy._version' from '/usr/lib/python3.6/site-packages/qtpy/_version.py'>
is_old_pyqt = False
is_pyqt46 = False
os = <module 'os' from '/usr/lib/python3.6/os.py'>
Comment by Stefano (senden9) - Thursday, 06 July 2017, 07:50 GMT
It works if I remove PyQT4.

$ pacman -Qo /usr/lib/python3.6/site-packages/PyQt4/
/usr/lib/python3.6/site-packages/PyQt4/ is owned by python-pyqt4 4.12-4
$ sudo pacman -Rns python-pyqt4
checking dependencies...
:: python-matplotlib optionally requires python-pyqt4: for Qt4Agg backend
:: python-pandas optionally requires python-pyqt4: needed for read_clipboard function (only one needed)
:: python-pillow optionally requires python-pyqt4: for the ImageQt module
:: python-pyperclip optionally requires python-pyqt4: qt backend
:: python-qtpy optionally requires python-pyqt4: Qt4 Python bindings
[...]

If I now start spyder3 the GUI starts without problems.
Comment by mentatf (mentatf) - Thursday, 06 July 2017, 07:59 GMT
Can confirm that it works when removing python-pyqt4.
Comment by Muflone (muflone) - Saturday, 08 July 2017, 18:51 GMT
Do you have such issue only when running spyder?
Do you have QT_API defined in your environment? (you can check yourself by executing "echo $QT_API" )
I think there must be some reason for your system to prefer the use of QT4 in place of QT5.
Comment by Stefano (senden9) - Sunday, 09 July 2017, 12:13 GMT
Hi,
"env | grep -i qt" just returns the variable LS_COLORS. No QT_API.
Comment by Muflone (muflone) - Sunday, 09 July 2017, 12:25 GMT
I could fix this issue in the spyder package.
Can you confirm you get this error only when starting spyder/spyder3?
Comment by Stefano (senden9) - Sunday, 09 July 2017, 16:00 GMT
I only got in when starting spyder. So I haven't seen this error somewhere else. Do you know some package that I should try to reproduce the error?
Comment by Muflone (muflone) - Sunday, 09 July 2017, 16:14 GMT
I don't know any other package that currently uses qtpy, I've packaged it only for the purpose to serve as spyder dependency.
Comment by Stefano (senden9) - Sunday, 09 July 2017, 16:18 GMT
I also only see spyder as „Required By“ of python2-qtpy / python-qtpy.
Comment by Muflone (muflone) - Sunday, 09 July 2017, 17:04 GMT
Fixed in spyder{,3} 3.1.4-2
Now spyder and spyder3 force the use of pyqt5 during the startup

Loading...