xrt icon indicating copy to clipboard operation
xrt copied to clipboard

ModuleNotFoundError: No module named 'PyQt5.QtWebKitWidgets'

Open mrakitin opened this issue 5 years ago • 8 comments

Dear developers,

@stuartcampbell and I are observing building issues when using the xrt package with pyqt >5.6 in conda, see https://github.com/NSLS-II/lightsource2-recipes/pull/676#pullrequestreview-236908198 for the detailed log of the error ModuleNotFoundError: No module named 'PyQt5.QtWebKitWidgets'. Are there any plans to support newer qt/pyqt versions?

Thank you! Maksim Rakitin

mrakitin avatar May 13 '19 21:05 mrakitin

have you tried pip install PyQtWebEngine ?

kklmn avatar May 14 '19 17:05 kklmn

You've made me check that we can actually work with the fresh pyqt versions, and the answer is positive on Windows 10, Kubuntu 18.10 and High Sierra, please see the screenshots below. In all three cases I used Anaconda, and on Windows 10 all the packages were the latest. So I suggest going through xrt.rtfd.io/instructions.html. Please report back on the progress/failures.

W10_s

Kubuntu18 10_s

HighSierra_s

kklmn avatar May 14 '19 17:05 kklmn

I can confirm that everything works fine on python 3.6.7 with qt 5.9.6, PyQt5 5.9.2 You could try to update your conda qt/pyqt installation as recommended here https://github.com/conda-forge/pyqt-feedstock/issues/19

yxrmz avatar May 14 '19 19:05 yxrmz

@mrakitin: any progress on the issue?

kklmn avatar Jun 01 '19 12:06 kklmn

Hi @kklmn, sorry for the late reply. No progress on that. I got stuck with conda-provided packages for PyQt5, not sure how to resolve it. pip packages seem to work though. I don't know if anything can be done on your side, e.g. using something else than QtWebKitWidgets, or making it an optional import?

mrakitin avatar Jun 05 '19 17:06 mrakitin

QtWebKitWidgets is our second choice:

    try:
        import PyQt5.QtWebEngineWidgets as QtWeb
    except ImportError:
        import PyQt5.QtWebKitWidgets as QtWeb

It is expected that you have QtWebKitWidgets only if you don't have QtWebEngineWidgets. Please do in a python session:

import PyQt5
import PyQt5.QtWebEngineWidgets

and provide the error message.

kklmn avatar Jun 05 '19 18:06 kklmn

Actually, the problem appeared to be related to the missing libEGL.so.1 lib:

ImportError: libEGL.so.1: cannot open shared object file: No such file or directory

See the details at https://travis-ci.org/NSLS-II/lightsource2-recipes/jobs/587514703#L1022. Installing libegl1-mesa in our Debian docker image (https://github.com/NSLS-II/debian-with-miniconda/pull/20) solved the problem.

The recipe was successfully build via:

  • https://github.com/nsls-ii-forge/xrt-feedstock/pull/2 (Linux/OSX/Windows) in the nsls2forge conda channel;
  • https://github.com/NSLS-II/lightsource2-recipes/pull/676 (Linux) in the lightsource2-tag conda channel.

Do you want to make this recipe/package available on conda-forge? It would be trivial to create one as we already have a working recipe feedstock using their infrastructure.

mrakitin avatar Sep 22 '19 18:09 mrakitin

I think this problem is resolved. Pending on your reply about the conda-forge.

mrakitin avatar Mar 03 '20 22:03 mrakitin