PyQt5: Cannot create cross-platform QtWebKitWidget application - linux

I've developed a PyQt5 application on Linux (Ubuntu 16.04 LTS) that uses a QtWebKitWidget (QtWebView). It works great on Linux. I'm trying to package it for distribution for Windows using cx_Freeze, but the resulting application stops execution at launch with the PyQt5 error message "Import Error: Cannot import name 'QtWebKitWidgets.'"
I read that QtWebKitWidgets was deprecated from PyQt5 as of Qt 5.6, and that I should now use QtWebEngineWidgets instead. Fair enough. But I can't seem to install QtWebEngineWidgets on Ubuntu. I've installed Qt Creator 5.10 (most recent as of Dec 2017), and tried to include QtWebEngine via the oinline installation wizard, but the QtWebView widget is not listed in the toolbox.
My question: how can I use a PyQt5 WebView widget that will be cross-platform? If I use QtWebKit, it works on Linux but not on Windows. If I use QtWebEngine, it should work on Windows but not Linux.
What do I need to install on both platforms?
(Thanks in advance.)

Related

PyQt5 & PySide2 / Could not load the Qt platform plugin "windows" in "" even though it was found

Development environment
1. Windows 10 / Python 3.6.8 / Pyinstaller 3.4 / PyQt5 5.10
2. Windows 10 / Python 3.6.8 / Pyinstaller 3.4 / PySide2 5.11.0
3. Windows 10 / Python 3.6.8 / Pyinstaller 3.4 / PyQt5 5.9.2
Execution environment
Windows Server 2008 SP2
In case 1, 2 : Below Error Occurred.
qt.qpa.plugin: Could not load the Qt platform plugin "windows" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized.
Reinstalling the application may fix this problem.
Available platform plugins are: minimal, offscreen, webgl, windows.
But case 3 : No Error.
The results of testing the higher versions than Qt 5.10 are the same as case 1, 2.
I must use PySide2. but PySide2 does not have a lower version than Qt 5.9.2.
Is there a way to avoid the error using PySide2 ?
With Anaconda:
conda install -c conda-forge pyside2
But is an older version. (v5.6)
With the older version, I did not encounter any problems so far. I have the same problem with the new version but I need it because the older does not have support for QtCharts

How to package PySide2 applications for distribution?

I has used CXFreeze in past to package python applications but in most cases the installer packages build thru CXFreeze failed to install when I distributed it to other users.
Is there a better way to create distributable for Pyside2 applications?
Try pyinstaller. I also do PySide2 projects and this installer works fine for me at least for windows applications. See https://pythonhosted.org/PyInstaller/.

Python 3 64bit - GUI Package

I have my code in Python3.5 64bit version. I wanted to use the Tkinter package to create a GUI for my application. However, "Tkinter" is compatible with 32-bit version and I could not find any source to solve this problem. Is there any other package to use for GUI development in Python 3 64-bit version?

gui2py with Phoenix (wxPython) Visual Tools error

So I have gui2py installed on my machine, running the latest version of Phoenix with Python 3.3. Both seem to be working fine. The problem is, when I try to start the Visual Tools editor, with the command that the site said to use:
Quick Start: Try the sample application in this directory, running:
python sample.pyw Also, you can start the visual GUI designer with:
python -m gui.tools.designer
Which tosses me the error:
ImportError: No module named 'wx.gizmos'
When the previous line in the console is:
File "C:\Python33\lib\site-packges\gui\tools\inspector.py", line 13, in <module>
import wx.gizmos as gizmos
Can anybody help me get this running? It is supposed to work with Phoenix and everything!
Applications built with gui2py will work on Python 3, but the designer itself will not run on py3k right now because some features are still not ported to wxPhoenix (mainly, property grid and some addons like wx.gizmos are missing or not yet finished in the upcoming version, but wx core developers stated that they will be ported).
Also, if you run your app with prior wxPython versions (for example, wx 2.8), some features also are not available and they will be degraded gracefully ("simulated").
The recommended environment to develop gui2py applications is using Python 2.7 and wxPython 2.9.4.0+.
Then, you can test your app in the other wx and python versions.
You can see the compatibility notes in the main project page: https://code.google.com/p/gui2py/

Why PyQt 4.9 dont have WebKit

I installed Qt 4.8 which have the support of QtWebkit. After that i tried installing PyQt-4.9. on my CentOS Server. I dont understand why the QtWebkit library is not installed. The Source package does not contain the package at all.
Can any one help me finding a PyQt source with Webkit?..
Right now i cant do from PyQt4.QtWebKit import QWebPage
try check you dev package of Qt4 on system.
i compile PyQt5 on Debian, but can find QtWebKit.
then i install libqt5webkit5-dev and compile PyQt5 again.
maybe helps.

Resources