phy icon indicating copy to clipboard operation
phy copied to clipboard

DLL load failed while importing QtWebEngineWidgets:

Open dmkobylkov opened this issue 3 years ago • 7 comments

Hi! I have created an environment in conda, installed thy phy in there, but I still cannot open the template gui. I always get the following error. Uninstalling and reinstalling of the QtWebEngineWidgets doesn't help. Could you help me to solve the problem? Thanks!

(phy2) C:\Users\dmitry.kobylkov\MATLAB\Projects\KilosortPLX\Outputs-chick46_160622_1.7.pl213-Sep-2022>phy template-gui params.py --debug
Traceback (most recent call last):
  File "C:\Users\dmitry.kobylkov\.conda\envs\phy2\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\dmitry.kobylkov\.conda\envs\phy2\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\dmitry.kobylkov\.conda\envs\phy2\Scripts\phy.exe\__main__.py", line 4, in <module>
  File "C:\Users\dmitry.kobylkov\.conda\envs\phy2\lib\site-packages\phy\apps\__init__.py", line 22, in <module>
    from phy.gui.qt import QtDialogLogger
  File "C:\Users\dmitry.kobylkov\.conda\envs\phy2\lib\site-packages\phy\gui\__init__.py", line 6, in <module>
    from .qt import (
  File "C:\Users\dmitry.kobylkov\.conda\envs\phy2\lib\site-packages\phy\gui\qt.py", line 41, in <module>
    from PyQt5.QtWebEngineWidgets import (QWebEngineView,  # noqa
ImportError: DLL load failed while importing QtWebEngineWidgets: The specified module could not be found.

dmkobylkov avatar Sep 13 '22 12:09 dmkobylkov

I am having the same error as of 9/21. I am able to run phy successfully on this machine in a different environment but when I install the developer version I get this error. Uninstalling and reinstalling PyQtWebEngine didn't help.

C:\Users\mh553\Phy\phylib-master\phylib-master>phy template-gui params.py Traceback (most recent call last): File "C:\Users\mh553\Anaconda3\envs\ForPhyllum\Scripts\phy-script.py", line 33, in sys.exit(load_entry_point('phy', 'console_scripts', 'phy')()) File "C:\Users\mh553\Anaconda3\envs\ForPhyllum\Scripts\phy-script.py", line 25, in importlib_load_entry_point return next(matches).load() File "C:\Users\mh553\Anaconda3\envs\ForPhyllum\lib\importlib\metadata.py", line 86, in load module = import_module(match.group('module')) File "C:\Users\mh553\Anaconda3\envs\ForPhyllum\lib\importlib_init_.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1030, in _gcd_import File "", line 1007, in _find_and_load File "", line 986, in _find_and_load_unlocked File "", line 680, in load_unlocked File "", line 850, in exec_module File "", line 228, in call_with_frames_removed File "c:\users\mh553\phy\phy-master\phy-master\phy\apps_init.py", line 22, in from phy.gui.qt import QtDialogLogger File "c:\users\mh553\phy\phy-master\phy-master\phy\gui_init.py", line 6, in from .qt import ( File "c:\users\mh553\phy\phy-master\phy-master\phy\gui\qt.py", line 41, in from PyQt5.QtWebEngineWidgets import (QWebEngineView, # noqa ImportError: DLL load failed while importing QtWebEngineWidgets: The specified module could not be found.

mariehemelt avatar Sep 19 '22 12:09 mariehemelt

A colleague had the same problem which we were able to fix:

pip uninstall PyQt5 pip uninstall PyQt5-sip pip uninstall PyQtWebEngine

pip install --upgrade pyqtwebengine==5.12 pip install --upgrade pyqt5==5.12.3

(the specific versions listed above were the lowest ones pypi was offering at the time)

You may need to manually remove the PyQt folders in Lib\site-packages and repeat the above steps but we didn't need to.

rhayman avatar Sep 24 '22 13:09 rhayman

Hello,

A colleague and I are having a similar error as of 12/8/22 (see attached), apparently with the PyQt5 and PyQTWebEngine packages. We tried performing a completely fresh install and following the instructions above, i.e. uninstalling and reinstalling earlier versions of pyqt5 and pyqtwebengine , to no avail.

Has there been a developer update for this issue?

phy2_error

hwehry avatar Dec 08 '22 15:12 hwehry

I finally found a solution that worked for my colleague and I.

Order of events:

  1. Install Anaconda

  2. Create an Anaconda environment with the major dependencies. The earlier versions of pyqt5/pyqt5-sip/pyqtwebengine are not available when installing, so I withheld the "pyqt" install for a later pip install.

conda create -n phy2 python=3.7 pip numpy matplotlib scipy scikit-learn h5py cython pillow -y

  1. Confirm that there are no pyqt related packages. If there are, then use the conda uninstall commands to remove them.

conda list

  1. Use pip to install the earliest possible recommended version of pyqt. Note that "pqt5" must be installed before the webengine. Otherwise the later version of pyqt5 is installed as part of the dependencies of the webengine, and installing the earlier version over it still results in the DLL load failure error seen above.

pip install pyqt5==5.12.1 pip install pyqtwebengine==5.12

using conda list also shows that ppyqt5-sip 4.19.19 is installed

  1. Proceed to install phy and run it as usual.

pip install phy --pre --upgrade

hwehry avatar Dec 08 '22 17:12 hwehry

It worked beautifully, thanks hwehry!!!

tkskdm2 avatar Dec 09 '22 04:12 tkskdm2

@hwehry Thank you for your suggestions. It did the job!

moscraciunxxx avatar Feb 17 '23 02:02 moscraciunxxx

Thanks hwehry, this was the best solution to solve my issue as well!

rahim-hashim avatar Mar 29 '23 18:03 rahim-hashim