Using PySide QtWebKit on Windows with py2exe

I am building a Python application using PySide and Qt, and I need to open a webpage, so I used QtWebKit QWebView.

On my development machine, it works just fine, and it runs the code directly, and runs the output of py2exe. On a "clean" machine (without Python and without Qt), py2exe output does not show a web page. The rest of the application works fine and there is no crash or exception, but QWebView just stays empty.

I tried to open the URL without images or other materials to prevent any problems related to the absence of WebKit plugins. I also tried a simple program that simply opens example.com in QWebView and nothing else, and it also does not work.

Has anyone come across something similar? Also, does anyone know if QWebKit has any “less documented” dependencies that py2exe might not pull into the “package”?

+3
source share
4 answers

I would try PyInstaller. It seems to work well when compiling PyQT material, as it sniffs the dependencies and packs them too (well, it seems like that). I also made a QT application with Python, and he spat out one binary file that worked right away.

Here's the link: http://www.pyinstaller.org/

Good luck

+2
source

For those who still have problems, you go:

http://developer.qt.nokia.com/wiki/Packaging_PySide_applications_on_Windows

py2exe:)

+2

py2exe:

packages = ["PySide.QtNetwok"]
+1

. , pyside QtWebKit, dev , , py2exe .

setup.py PySide.QtNetwork:

...
setup(
    ...
    options = {
        'py2exe': {
            ...
            'includes': ['PySide.QtNetwork'],
            ...
        }
    }
...

DLL openSSL:

go win32openssl ( ) libeay32.dll ssleay32.dll setup.py :

...
setup(data_files=[('', ['libeay32.dll','ssleay32.dll'])],
...

, , : , :

...
setup(data_files=[("imageformats", glob(r'C:\Python27\Lib\site-packages\PySide\plugins\*.*')),('', ['libeay32.dll','ssleay32.dll'])],
...
+1

Source: https://habr.com/ru/post/1784153/


All Articles