I want to make an app with PyQt5. I installed packages as
pyqt5==5.15.3
PyQtWebEngine==5.15.3
pyqtgraph
...
# app.py
from PyQt5.QtCore import QObject, QVariant, pyqtSlot, QUrl, pyqtSignal, Qt
from PyQt5.QtGui import QIcon
from PyQt5.QtWebChannel import QWebChannel
...
When I execute from PyQt5.QtWebChannel import QWebChannel in cmd, it does not make an error.
But when I execute the app with PyCharm, import error occured.
from PyQt5.QtWebChannel import QWebChannel
ImportError: DLL load failed while importing QtWebChannel: the specified module could not be found
I checked sys.path before importing QtWebChannel.
Both of cmd and app have same sys.path and the sys.path are here.
C:\Users\Intelli2002\AppData\Local\Programs\Python\Python38\python38.zip
C:\Users\Intelli2002\AppData\Local\Programs\Python\Python38\DLLs
C:\Users\Intelli2002\AppData\Local\Programs\Python\Python38\lib
C:\Users\Intelli2002\AppData\Local\Programs\Python\Python38
D:\_venv
D:\_venv\lib\site-packages
D:\_venv\lib\site-packages\numpy-1.23.5-py3.8-win-amd64.egg
D:\_venv\lib\site-packages\opencv_python_headless-4.7.0.72-py3.8-win-amd64.egg
D:\_venv\lib\site-packages\win32
D:\_venv\lib\site-packages\win32\lib
D:\_venv\lib\site-packages\Pythonwin
There are QtWebChannel.pyd and QtWebChannel.pyi files in PyQt5 directory
Also, there is QtWebChannel.dll in PyQt5/Qt5/bin
from PyQt5.QtGui import QIcon does not make an error, it means python could find the PyQt5 properly.
I double checked it as followings.
import PyQt5
print(PyQt5.__file__) # D:_venv\lib\site-packages\PyQt5\__init__.py
import PyQt5.QtCore
print(PyQt5.QtCore.__file__) # D:\_venv\lib\site-packages\PyQt5\QtCore.pyd
import PyQt5.QtGui
print(PyQt5.QtGui.__file__) # D:\_venv\lib\site-packages\PyQt5\QtGui.pyd
I repeat uninstalling and installing PyQT5. But it does not help me...
Why importing QtWebChannel makes an import error???
My Environments:
- OS : Windows 10
- Python : python3.8.10