Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No module named 'PyQt5.QtWebEngineWidgets' #432

Open
PedroVenancio opened this issue Oct 18, 2024 · 8 comments
Open

No module named 'PyQt5.QtWebEngineWidgets' #432

PedroVenancio opened this issue Oct 18, 2024 · 8 comments

Comments

@PedroVenancio
Copy link

I'm trying to install SIFT on a fresh Ubuntu 24.04.1 with Miniforge, following the instructions: https://sift.readthedocs.io/en/latest/installation.html#installing-with-conda

Everything seems to be fine, but when I run SIFT GUI I get:

(sift_env) pedro@omen:~$ python -m uwsift
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/pedro/miniforge3/envs/sift_env/lib/python3.12/site-packages/uwsift/__main__.py", line 39, in <module>
    from uwsift.control.layer_tree import LayerStackTreeViewModel
  File "/home/pedro/miniforge3/envs/sift_env/lib/python3.12/site-packages/uwsift/control/layer_tree.py", line 47, in <module>
    from uwsift.view.colormap_dialogs import ChangeColormapDialog
  File "/home/pedro/miniforge3/envs/sift_env/lib/python3.12/site-packages/uwsift/view/colormap_dialogs.py", line 6, in <module>
    from uwsift.ui.change_colormap_dialog_ui import Ui_changeColormapDialog
  File "/home/pedro/miniforge3/envs/sift_env/lib/python3.12/site-packages/uwsift/ui/change_colormap_dialog_ui.py", line 81, in <module>
    from uwsift.ui.custom_widgets import QNoScrollDoubleSpinBox
  File "/home/pedro/miniforge3/envs/sift_env/lib/python3.12/site-packages/uwsift/ui/custom_widgets.py", line 3, in <module>
    from PyQt5.QtWebEngineWidgets import QWebEngineView
ModuleNotFoundError: No module named 'PyQt5.QtWebEngineWidgets'

This issue seems related to #233

@ameraner
Copy link
Collaborator

Hi @PedroVenancio , if you are installing from conda, you are getting an old version of SIFT (likely v1.2.3), since the latest v2 is not yet released on conda as it is still in beta status. The issue is likely solved on v2, so I would suggest to try to install the latest SIFT from github directly, following the instructions here: https://sift.readthedocs.io/en/latest/dev_guide/contributing.html#dev-install . Please let us know how that goes!

@lmeru
Copy link

lmeru commented Oct 23, 2024

Hi @ameraner, I have a problem similar to that described by @PedroVenancio, but I haven't try to install the latest yet (yes, my version loaded from conda-forge is v 1.2.3). I'll try to do it asap.
Here's a brief report of what I tried, sent before to Dave Hoese that re-addressed me here:
I've created a fresh sift_env (with miniforge) and when I try to run sift from the activated sift_env with the command python -m uwsift as described in https://sift.readthedocs.io/en/latest/installation.html
I obtain the following:
(sift_env) luca@zeta-X1:~$ python -m uwsift
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in _run_code
File "/home/luca/miniforge3/envs/sift_env/lib/python3.12/site-packages/uwsift/main.py", line 39, in
from uwsift.control.layer_tree import LayerStackTreeViewModel
File "/home/luca/miniforge3/envs/sift_env/lib/python3.12/site-packages/uwsift/control/layer_tree.py", line 47, in
from uwsift.view.colormap_dialogs import ChangeColormapDialog
File "/home/luca/miniforge3/envs/sift_env/lib/python3.12/site-packages/uwsift/view/colormap_dialogs.py", line 6, in
from uwsift.ui.change_colormap_dialog_ui import Ui_changeColormapDialog
File "/home/luca/miniforge3/envs/sift_env/lib/python3.12/site-packages/uwsift/ui/change_colormap_dialog_ui.py", line 81, in
from uwsift.ui.custom_widgets import QNoScrollDoubleSpinBox
File "/home/luca/miniforge3/envs/sift_env/lib/python3.12/site-packages/uwsift/ui/custom_widgets.py", line 3, in
from PyQt5.QtWebEngineWidgets import QWebEngineView
ModuleNotFoundError: No module named 'PyQt5.QtWebEngineWidgets'

I then tried with this:
(sift_env) luca@zeta-X1:~$ mamba install PyQtWebEngine

obtaining:
(sift_env) luca@zeta-X1:~$ python3 -m uwsift
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in _run_code
File "/home/luca/miniforge3/envs/sift_env/lib/python3.12/site-packages/uwsift/main.py", line 54, in
from uwsift.view.scene_graph import SceneGraphManager
File "/home/luca/miniforge3/envs/sift_env/lib/python3.12/site-packages/uwsift/view/scene_graph.py", line 50, in
from uwsift.view.visuals import (NEShapefileLines, TiledGeolocatedImage, RGBCompositeLayer, PrecomputedIsocurve)
File "/home/luca/miniforge3/envs/sift_env/lib/python3.12/site-packages/uwsift/view/visuals.py", line 34, in
from vispy.gloo.texture import should_cast_to_f32
ImportError: cannot import name 'should_cast_to_f32' from 'vispy.gloo.texture' (/home/luca/miniforge3/envs/sift_env/lib/python3.12/site-packages/vispy/gloo/texture.py)

@lmeru
Copy link

lmeru commented Oct 24, 2024

Hi @ameraner this is what I obtained trying to install the beta version following the instructions on https://sift.readthedocs.io/en/latest/dev_guide/contributing.html#dev-install :
(sift_env) luca@zeta-X1:~$ pip install git+https://github.com/ssec/sift.git
Collecting git+https://github.com/ssec/sift.git
Cloning https://github.com/ssec/sift.git to /tmp/pip-req-build-c4caprsj
Running command git clone --filter=blob:none --quiet https://github.com/ssec/sift.git /tmp/pip-req-build-c4caprsj
Resolved https://github.com/ssec/sift.git to commit 6a4aa6d
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: appdirs in ./miniforge3/envs/sift_env/lib/python3.12/site-packages (from uwsift==2.0.0b1) (1.4.4)
Requirement already satisfied: donfig>=0.8.1 in ./miniforge3/envs/sift_env/lib/python3.12/site-packages (from uwsift==2.0.0b1) (0.8.1.post1)
Requirement already satisfied: h5py in ./miniforge3/envs/sift_env/lib/python3.12/site-packages (from uwsift==2.0.0b1) (3.12.1)
Requirement already satisfied: imageio in ./miniforge3/envs/sift_env/lib/python3.12/site-packages (from uwsift==2.0.0b1) (2.36.0)
Collecting av (from uwsift==2.0.0b1)
Using cached av-13.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (4.4 kB)
Requirement already satisfied: matplotlib in ./miniforge3/envs/sift_env/lib/python3.12/site-packages (from uwsift==2.0.0b1) (3.9.2)
Requirement already satisfied: netCDF4 in ./miniforge3/envs/sift_env/lib/python3.12/site-packages (from uwsift==2.0.0b1) (1.7.1)
Requirement already satisfied: numba in ./miniforge3/envs/sift_env/lib/python3.12/site-packages (from uwsift==2.0.0b1) (0.60.0)
Requirement already satisfied: numpy in ./miniforge3/envs/sift_env/lib/python3.12/site-packages (from uwsift==2.0.0b1) (2.0.2)
Requirement already satisfied: pillow in ./miniforge3/envs/sift_env/lib/python3.12/site-packages (from uwsift==2.0.0b1) (11.0.0)
Requirement already satisfied: pyproj in ./miniforge3/envs/sift_env/lib/python3.12/site-packages (from uwsift==2.0.0b1) (3.7.0)
Requirement already satisfied: pyqt5>=5.15 in ./miniforge3/envs/sift_env/lib/python3.12/site-packages (from uwsift==2.0.0b1) (5.15.9)
Requirement already satisfied: pyqtgraph in ./miniforge3/envs/sift_env/lib/python3.12/site-packages (from uwsift==2.0.0b1) (0.13.7)
Requirement already satisfied: pyqtwebengine in ./miniforge3/envs/sift_env/lib/python3.12/site-packages (from uwsift==2.0.0b1) (5.15.4)
Requirement already satisfied: pyshp in ./miniforge3/envs/sift_env/lib/python3.12/site-packages (from uwsift==2.0.0b1) (2.3.1)
Requirement already satisfied: pyyaml in ./miniforge3/envs/sift_env/lib/python3.12/site-packages (from uwsift==2.0.0b1) (6.0.2)
Requirement already satisfied: rasterio in ./miniforge3/envs/sift_env/lib/python3.12/site-packages (from uwsift==2.0.0b1) (1.4.1)
Requirement already satisfied: satpy in ./miniforge3/envs/sift_env/lib/python3.12/site-packages (from uwsift==2.0.0b1) (0.52.0)
Requirement already satisfied: scikit-image in ./miniforge3/envs/sift_env/lib/python3.12/site-packages (from uwsift==2.0.0b1) (0.24.0)
Requirement already satisfied: shapely in ./miniforge3/envs/sift_env/lib/python3.12/site-packages (from uwsift==2.0.0b1) (2.0.6)
Requirement already satisfied: sqlalchemy in ./miniforge3/envs/sift_env/lib/python3.12/site-packages (from uwsift==2.0.0b1) (2.0.36)
Requirement already satisfied: trollsift in ./miniforge3/envs/sift_env/lib/python3.12/site-packages (from uwsift==2.0.0b1) (0.5.1)
Requirement already satisfied: vispy>=0.10.0 in ./miniforge3/envs/sift_env/lib/python3.12/site-packages (from uwsift==2.0.0b1) (0.14.3)
INFO: pip is looking at multiple versions of uwsift to determine which version is compatible with other requirements. This could take a while.
ERROR: Could not find a version that satisfies the requirement ecmwflibs (from uwsift) (from versions: none)
ERROR: No matching distribution found for ecmwflibs

@ameraner
Copy link
Collaborator

Ah, that is because there are no ecmwflibs wheels for python 3.12 - in the setup.py we limit to <=3.11 (https://github.com/ssec/sift/blob/master/setup.py#L230C5-L230C99). Can you please try with a py3.11 environment? then it should finally work :)

@lmeru
Copy link

lmeru commented Oct 29, 2024 via email

@PedroVenancio
Copy link
Author

Hi @ameraner and all,

Sorry for the late reply.

I had to install conda with Python 3.10:

conda create -n sift_env -c conda-forge --strict-channel-priority python=3.10

and then

pip install git+https://github.com/ssec/sift.git

python -m uwsift

After that, I had to install some more dependencies:

pip install hdf5plugin dask[dataframe] defusedxml pyspectral rioxarray pyhdf pygac PyQtChart

And finally it worked, but still with several segmentation faults when opening data.

It would be very usefull if you can share a Linux bundle for Debian based systems (Debian, Ubuntu, etc.) with all dependencies.

Thank you very much!

Best regards,
Pedro

@ameraner
Copy link
Collaborator

@PedroVenancio : you can find bundles for Linux here: https://bin.ssec.wisc.edu/pub/sift/dist/experimental/ , e.g. https://bin.ssec.wisc.edu/pub/sift/dist/experimental/SIFT_2.0.0b1dev_linux_20241011_150832.tar.gz

@lmeru : did you install sift from conda in the new py3.11 env? I am wondering since the failing line was removed almost two years ago from master, so looks like you're still using an old version of SIFT: 9428ddb .

@lmeru
Copy link

lmeru commented Oct 31, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants