NCAS-CMS / cf-view

Exploration and plotting GUI for netCDF and Met Office format data
https://ncas-cms.github.io/cf-view/build/
MIT License
3 stars 4 forks source link

cf view fails to load with PIL error #16

Open bnlawrence opened 3 months ago

bnlawrence commented 3 months ago

Recent install of cf-view in a docker container fails with:

from PIL.ImageQt import ImageQt
ImportError: cannot import name 'ImageQt' from 'PIL.ImageQt' (/opt/conda/envs/datatools/lib/python3.12/site-packages/PIL/ImageQt.py). Did you mean: 'Image'?

The Dockerfile for reproduction is:

FROM condaforge/mambaforge

#Update and install extra tools.
RUN apt-get -y update && DEBIAN_FRONTEND=noninteractive apt-get -y install qt5-default graphviz plantuml

#mamba update and emsvaltool
RUN mamba update -y conda mamba pip && mamba create -y --name datatools 

#set conda env
SHELL ["conda", "run", "--name", "datatools", "/bin/bash", "--login", "-c"]

#cf-python and other tools
RUN mamba install -c conda-forge cf-python cf-plot ipython gcc gfortran gdb make cmake libtool && conda clean --all -y
RUN pip install cf-view #Not yet in conda

#nuke dash
RUN rm /bin/sh&&ln -s /bin/bash /bin/sh

ENV PYTHONNOUSERSITE=1

RUN echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc&&echo "conda activate datatools" >> ~/.bashrc

Which is then run with: docker run -e DISPLAY=host.docker.internal:0 -it ncas/dtools24:v1 and within the container: cfview.