cellpose icon indicating copy to clipboard operation
cellpose copied to clipboard

DLL load fail while importing QtGui

Open lifengyeh opened this issue 1 year ago • 2 comments

I installed cellpose[gui] and encounter similar error that reported in #505 . Fresh reinstall of cellpose[all] has been tried but the issue seems remains. I also tried to reinstall pyqt5 packages and did not solve the problem. My windows system is windows 10.

(cellpose2) C:\WINDOWS\system32>python -m cellpose
GUI ERROR: DLL load failed while importing QtGui: The specified module could not be found.
GUI FAILED: GUI dependencies may not be installed, to install, run
     pip install cellpose[gui]

and my package list is

(cellpose2) C:\WINDOWS\system32>conda list
# packages in environment at C:\ProgramData\Anaconda3\envs\cellpose2:
#
# Name                    Version                   Build  Channel
ca-certificates           2022.07.19           haa95532_0
cachetools                5.2.0                    pypi_0    pypi
cellpose                  2.1.0                    pypi_0    pypi
certifi                   2022.6.15        py38haa95532_0
charset-normalizer        2.1.1                    pypi_0    pypi
click                     7.1.2                    pypi_0    pypi
cloudpickle               2.1.0                    pypi_0    pypi
colorama                  0.4.5                    pypi_0    pypi
dask                      2022.8.1                 pypi_0    pypi
dask-image                2021.12.0                pypi_0    pypi
fastremap                 1.13.3                   pypi_0    pypi
fsspec                    2022.8.0                 pypi_0    pypi
google-api-core           2.8.2                    pypi_0    pypi
google-auth               2.11.0                   pypi_0    pypi
google-cloud-core         2.3.2                    pypi_0    pypi
google-cloud-storage      2.5.0                    pypi_0    pypi
google-crc32c             1.3.0                    pypi_0    pypi
google-resumable-media    2.3.3                    pypi_0    pypi
googleapis-common-protos  1.56.4                   pypi_0    pypi
idna                      3.3                      pypi_0    pypi
imagecodecs               2022.8.8                 pypi_0    pypi
imageio                   2.21.2                   pypi_0    pypi
joblib                    1.1.0                    pypi_0    pypi
llvmlite                  0.39.0                   pypi_0    pypi
locket                    1.0.0                    pypi_0    pypi
natsort                   8.1.0                    pypi_0    pypi
numba                     0.56.0                   pypi_0    pypi
numpy                     1.22.4                   pypi_0    pypi
opencv-python-headless    4.6.0.66                 pypi_0    pypi
openssl                   1.1.1q               h2bbff1b_0
partd                     1.3.0                    pypi_0    pypi
pillow                    9.2.0                    pypi_0    pypi
pims                      0.6.1                    pypi_0    pypi
pip                       22.1.2           py38haa95532_0
protobuf                  4.21.5                   pypi_0    pypi
pyasn1                    0.4.8                    pypi_0    pypi
pyasn1-modules            0.2.8                    pypi_0    pypi
pyparsing                 3.0.9                    pypi_0    pypi
pyqt5                     5.15.4                   pypi_0    pypi
pyqt5-plugins             5.15.4.2.2               pypi_0    pypi
pyqt5-sip                 12.11.0                  pypi_0    pypi
pyqt5-tools               5.15.4.3.2               pypi_0    pypi
pyqtgraph                 0.12.4                   pypi_0    pypi
python                    3.8.5                h5fd99cc_1
python-dotenv             0.20.0                   pypi_0    pypi
pyyaml                    6.0                      pypi_0    pypi
qt5-applications          5.15.2.2.2               pypi_0    pypi
qt5-tools                 5.15.2.1.2               pypi_0    pypi
requests                  2.28.1                   pypi_0    pypi
rsa                       4.9                      pypi_0    pypi
scikit-learn              1.1.2                    pypi_0    pypi
scipy                     1.9.1                    pypi_0    pypi
setuptools                63.4.1           py38haa95532_0
six                       1.16.0                   pypi_0    pypi
slicerator                1.1.0                    pypi_0    pypi
sqlite                    3.39.2               h2bbff1b_0
threadpoolctl             3.1.0                    pypi_0    pypi
tifffile                  2022.8.12                pypi_0    pypi
toolz                     0.12.0                   pypi_0    pypi
torch                     1.12.1                   pypi_0    pypi
tqdm                      4.64.0                   pypi_0    pypi
typing-extensions         4.3.0                    pypi_0    pypi
urllib3                   1.26.12                  pypi_0    pypi
vc                        14.2                 h21ff451_1
vs2015_runtime            14.27.29016          h5e58377_2
wheel                     0.37.1             pyhd3eb1b0_0
wincertstore              0.2              py38haa95532_2
zipp                      3.8.1                    pypi_0    pypi

lifengyeh avatar Aug 31 '22 03:08 lifengyeh

just to clarify here, you made a new environment with conda create --name cellpose python=3.8?

carsen-stringer avatar Sep 09 '22 13:09 carsen-stringer

Hello. I met the same problem when installing on Windows 11 and following the instructions (I used conda create --name cellpose python=3.8). The version of PyQT I had, causing the problem was: PyQt5 5.15.7

The fix I found was to use another version of PyQT:

pip install PyQT5==5.15.0

Then the GUI worked again.

tinevez avatar Oct 05 '22 07:10 tinevez

I had this issue too after I installed tensorflow at the base env in Anaconda. Link explained one possible clue. Issue was solved after I removed system environment variable LD_LIBRARY_PATH that I made by following tensorflow install guides.

I ended up starting with the fresh Ubuntu 22.04 Just installed Anaconda --> graphic drivers (PPA) --> cudatoolkit at the base env

Then, create cellpose env with python=3.8 --> python -m installed cellpose --> installed gui ver. I could run cellpose with gpu, and I did not install any other pytorch or cudatoolkits in this env.

Note: you can still install different versions of cudnn & tensorflow & cudatoolkit, etc... in another env and run compatible package with my setup.

Hope it helps. Thanks!

gl2772CU avatar Oct 11 '22 05:10 gl2772CU

thanks for the help, I'll provide this info in the readme

carsen-stringer avatar Nov 06 '22 16:11 carsen-stringer