Closed jschueller closed 7 years ago
Could you try with other Python versions?
Yes, same thing with 2.7, 3.5: PyQt5.QtWebKitWidgets is not available (still on linux).
Can you try without the trailing /
in your new PATH
entry, and also add a $
before the 2nd PATH
, i.e. change: PATH=$HOME/miniconda/bin/:PATH orange-canvas
to PATH=$HOME/miniconda/bin:$PATH orange-canvas
oups, no, the bug is still present, comes down to:
PATH=$HOME/miniconda/bin:$PATH python -c "from PyQt5.QtWebKitWidgets import *"
The actual problem is a few lines above
ModuleNotFoundError: No module named 'PyQt5.QtWebEngineWidgets'
When it is not found, AnyQt falls back to QtWebKit, which was available in older versions of qt. As of why PyQt5.QtWebEngineWidgets is not available, I have no idea.
As pyqt/qt from defaults seem to work just fine, I use
conda install -c defaults pyqt=5 qt
as a workaround.
Never mind, I have just checked, qt from defaults channel includes QtWebKit. PyQt5 from pypi is the one that has QtWebEngine.
As of why PyQt5.QtWebEngineWidgets is not available, I have no idea.
This may be because QtWebEngine can only be compiled and run on very modern operating system releases.
As of why PyQt5.QtWebEngineWidgets is not available, I have no idea.
Conda packages don't provide those widgets because they require C++11 capable compilers and more modern Linux versions than those supported by Continuum (i.e. CentOS 5).
So do we need to be building qt
with WebKit like we do on Windows? See https://github.com/conda-forge/qt-feedstock/blob/master/recipe/bld.bat#L34
so it's not the lack of cxx11
It is the lack of c++11 (on Windows) and on centos5, for defaults, the lack of modern glibc, kernel and opengl.
If c++11 wasn't a show stopper on Windows I would have tried to figure a way of getting webengine to work as well as I could on Linux as then we'd have had uniformity across all OSes.
To be a bit more specific, the problem is with supporting WebEngine is Python 2.7 on Windows.
Besides, WebKit and WebEngine have some (minor but annoying) incompatibilities. So in the spirit of maintaining compatibility between conda-forge and defaults, I'd prefer conda-forge to continue using WebKit.
In any case, the problem here is the lack of WebKit in Qt5. I thought it was compiled correctly... @ocefpaf?
any updates on this?
the bug is still there
What is the long-term plan here? QtWebKit is deprecated and is gone in Qt 5.6. Although I think it has some advantages over QtWebEngine, people are going to be caught in the middle if QtWebKit is gone and QtWebEngine isn't yet provided. There is a "reboot" of QtWebKit that would be cool if it could somehow be set up as a conda package to integrate with PyQt5.
AFAIK QtWebit is built as part of the Qt build on Linux (https://github.com/conda-forge/qt-feedstock/blob/master/recipe/bld.bat#L40) and Windows (https://github.com/conda-forge/qt-feedstock/blob/master/recipe/build.sh#L9). I think @mingwandroid worked out how to do this originally.
On my Linux box I definitely have a libQt5WebKit.so
installed in my Conda env.
Is the problem that pyqt
isn't picking up we have Webit rather than WebEngine?
Interesting, you're right. Is the plan to continue supporting and supplying that independently of the upstream Qt?
I think so. At least until Python 2.7 goes away on Windows and the gcc used for building on Linux is upgraded. @ccordoba12 and @ocefpaf probably have more insight here...
We haven't started to consider when we're going to move to a more recent Qt version. But when we do, I think we will also move from QtWebkit to QtWebengine.
@jschueller can you confirm whether this has been fixed? from PyQt5.QtWebKitWidgets import QWebView
seems fine on Linux now....
My concern is that there appears to be no combination of web engine widget and future support. Right now we have QtWebKit, which is great, but I don't want to depend on that that unless there's a clear intention to continue providing it in the future. The alternative is QtWebEngine, which is what Qt apparently has committed to supporting in the future, but that's not available. So people trying to write reasonably future-proof code are caught in the middle.
Hi Guys, I know you are talking about QtWebKit (that is gone in Qt 5.6.) and now there is this PyQt5.QtWebEngineWidgets (that's not available). How can I create a browser page with QT5 so? I just want to make this code(in the example) https://pythonspot.com/en/pyqt5-browser/ work. Please, give me some direction, I have been searching for days that things...
Use QtWebKit instead of QWebEngine. Their APIs are mostly the same.
Is there any version of QT Designer that uses QtWebKit instead of QWebEngine with PyQt5? I would like to design a GUI with QTDesigner on Windows and I would like to add a web browser. I can use QtWebKit, as suggested by @ccordoba12, but it seems that with any version of PyQt5, QT Designer uses QWebEngine.
@ccordoba12 it seems from the original post that qtwebkit is also missing from pyqt5 which makes it impossible to launch spyder from a conda-forge install.
@SylvainCorlay, there's is a test that verifies its presence:
but it's not activated for macOS (I don't know why). Is your problem related only to that platform?
@ccordoba12 I have only seen it on OSX (Sylvain poked you on my behalf)
I have the same issue. I have no idea how it occurs. Tried many ways to solve, unfortunately failed all. So I delete anaconda using command line and reinstall everything and it worked.
this is problem with pyqt5 version you can try pip install pyqt5==pyqt5.8 or same for conda , i think this can help
If running spyder
from the terminal returns the following issue:
Traceback (most recent call last):
File "C:\Users\999138\AppData\Local\Continuum\anaconda3\lib\site-packages\qtpy\QtWebEngineWidgets.py", line 22, in <module>
from PyQt5.QtWebEngineWidgets import QWebEnginePage
ImportError: DLL load failed: The specified procedure could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\999138\AppData\Local\Continuum\anaconda3\Scripts\spyder-script.py", line 10, in <module>
sys.exit(main())
File "C:\Users\999138\AppData\Local\Continuum\anaconda3\lib\site-packages\spyder\app\start.py", line 186, in main
from spyder.app import mainwindow
File "C:\Users\999138\AppData\Local\Continuum\anaconda3\lib\site-packages\spyder\app\mainwindow.py", line 90, in <module>
from qtpy import QtWebEngineWidgets # analysis:ignore
File "C:\Users\999138\AppData\Local\Continuum\anaconda3\lib\site-packages\qtpy\QtWebEngineWidgets.py", line 26, in <module>
from PyQt5.QtWebKitWidgets import QWebPage as QWebEnginePage
ModuleNotFoundError: No module named 'PyQt5.QtWebKitWidgets'
It is then a bug.
Overcoming the bug is in done 2 steps:
Step 1
conda update -c conda-forge qt pyqt
Step 2
Launch spyder
from Anaconda Navigator, not for the terminal.
This applies for Microsoft Windows 10.
PS: to get back to the official repository, please the channel pkgs/main
conda update -c pkgs/main qt pyqt
If running spyder from the terminal returns the following issue:
You are meant to use The Anaconda Prompt or else activate your conda env manually.
What I was talking about is the Windows terminal.
Summary
spyder
is always working from the Anaconda-Navigator. But you can not import PyQt5.QtWebKitWidgets
if you have done this command conda update -c conda-forge qt pyqt
.spyder
is always not working from Windows Prompt (whatever you run this command or not: conda update -c conda-forge qt pyqt
).spyder
works from Anaconda Prompt and importing PyQt5.QtWebKitWidgets
works if conda update -c conda-forge qt pyqt
.I hope my answer is clearer.
Why do you need to use conda-forge in the first place?
What I was talking about is the Windows terminal.
This is unsupported unless you activate your conda env.
I hope my answer is clearer.
Your bug report is irrelevant since we do not support non-activation.
pip install PyQtWebEngine
solved it for me.
pip install PyQtWebEngine
solved it for me.
Just solved my case too (on Win8). Thanks!
Solved it for me (MacOsX@10.12.6 - python@3.6.5). Thanks.
pip install PyQtWebEngine
solved it for me.
Solved my case ( win10 ) Thanks..
totaly,
If you use
pip install spyder
then you need
pip install PyQtWebEngine
Finally you can run spyder3.exe
on cmd or powershell
pip install --upgrade PyQtWebEngine ?
pip install PyQtWebEngine
solved it for me.Solved my case ( win10 ) Thanks.. totaly, If you use
pip install spyder
then you needpip install PyQtWebEngine
Finally you can run
spyder3.exe
on cmd or powershell
Any reason this isn't a dependency of spyder?
I did a mistake.
I am used to work on linux, So when I started working on Windows 10, the command line spyder
returns me that error (PyQtWebEngine is missing.)
To cut it short, Windows 10 needs that you do the following commands:
activate YOUR_PY_ENV
spyder
And every thing will run smoothly.
:)
@Russell-Jones-OxPhys
Any reason this isn't a dependency of spyder?
It would be foolish for spyder to specify a source of software. Software may specify dependencies, but it should not constrain where those dependencies come from.
You're finding a solution that may break other software. Other programs that have been compiled against a different version of Qt may break with the way you've done things. Our advice here has been to activate your environments. There's also an environment variable you can set to change our python's DLL search behavior. This is described in https://conda.io/projects/conda/en/latest/user-guide/troubleshooting.html#numpy-mkl-library-load-failed.
The problem is not that qtwebengine is missing from conda-forge's pyqt. The problem is that it is present, but without activation, python does not know how to find it. Good luck.
@msarahan I don't recall finding any solution, rather asking a question. Thank you for answering it. I don't think it would be foolish, rather convenient, however I can see that the different ways of working that conda and virtualenv have conflict. it seems the solution for a conda environment is quite different from a stand-alone virtualenv, though it's not clear to me why dependencies specified in PyPI limit those available to conda-- is it to allow for the case where a virtualenv is layered on top of a conda env?
you can try one of these solution ,
install old version :
pip install PyQt5==5.11.3
or install :
pip install PyQtWebEngine
I have same problem and solved with this solution.
This works for me: In windows 10 (run this in conda prompt, might need to run as admin)
conda install --force-reinstall pyqt qt
I solved same issue by installing qt bindings from conda web page, https://anaconda.org/anaconda/pyqt.
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/qtpy/QtWebEngineWidgets.py", line 22, in
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/spyder3", line 11, in
I experienced this issue on RHEL 7 and after installing libXScrnSaver-1.2.2-6.1.el7 the issue was resolved.
I cannot run conda-forge/orange3 (linux/py36) because of missing import:
It works if I install pyqt/qt from defaults.