Giter VIP home page Giter VIP logo

python-qt5's Introduction

Unofficial PyQt5 via PyPI for Python 2.7 64-bit on Windows

Build status PyPI version




A) Install with pip and git

With this approach, you get version 5.7.1

$ pip install git+git://github.com/pyqt/python-qt5.git

B) Or install with just pip

With this approach, you only get 5.3 due to space restrictions on PyPI.

$ pip install python-qt5

C) Or install with just git




Testing out the installation

  1. Launch Python
  2. Type this in
>>> import sys
>>> from PyQt5 import QtWidgets
>>> app = QtWidgets.QApplication(sys.argv)
>>> button = QtWidgets.QPushButton("Hello")
>>> button.setFixedSize(400, 400)
>>> button.show()
>>> app.exec_()
  • More information in the Wiki

python-qt5's People

Contributors

morefigs avatar mottosso avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

python-qt5's Issues

qt.conf not included

When installing from PyPI, the qt.conf file isn't appearing next to the Python executable.

`python': double free or corruption on PyQt5 software

Hi!

I'm working with pyqt and some charts (pyqtgraph, matplotlib) and a bunch of data every second. Now it shows this error and is related to pyqt and qtdbus. What can i do?


*** Error in `python': double free or corruption (fasttop): 0x00007fb70800c3f0 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x7c619)[0x7fb7d8b57619]
/lib64/libdbus-1.so.3(dbus_message_unref+0xc2)[0x7fb7c3bc4fb2]
/home/datawork/.virtualenvs/datawork/lib/python3.6/site-packages/PyQt5/Qt/lib/libQt5DBus.so.5(+0x598bc)[0x7fb7c3e4e8bc]
/home/datawork/.virtualenvs/datawork/lib/python3.6/site-packages/PyQt5/Qt/lib/libQt5Core.so.5(_ZN9QMetaType8destructEiPv+0xa6)[0x7fb7cb2dc646]
/home/datawork/.virtualenvs/datawork/lib/python3.6/site-packages/PyQt5/Qt/lib/libQt5DBus.so.5(+0x1b3b4)[0x7fb7c3e103b4]
/home/datawork/.virtualenvs/datawork/lib/python3.6/site-packages/PyQt5/Qt/lib/libQt5DBus.so.5(_ZN12QDBusMessageD1Ev+0x1b)[0x7fb7c3e23d5b]
/home/datawork/.virtualenvs/datawork/lib/python3.6/site-packages/PyQt5/Qt/lib/libQt5DBus.so.5(+0x2a65c)[0x7fb7c3e1f65c]
/home/datawork/.virtualenvs/datawork/lib/python3.6/site-packages/PyQt5/Qt/lib/libQt5Core.so.5(_ZN23QCoreApplicationPrivate16sendPostedEventsEP7QObjectiP11QThreadData+0x2e5)[0x7fb7cb2c9495]
/home/datawork/.virtualenvs/datawork/lib/python3.6/site-packages/PyQt5/Qt/lib/libQt5Core.so.5(+0x2d3563)[0x7fb7cb31b563]
/lib64/libglib-2.0.so.0(g_main_context_dispatch+0x159)[0x7fb7c81ba4c9]
/lib64/libglib-2.0.so.0(+0x4a818)[0x7fb7c81ba818]
/lib64/libglib-2.0.so.0(g_main_context_iteration+0x2c)[0x7fb7c81ba8cc]
/home/datawork/.virtualenvs/datawork/lib/python3.6/site-packages/PyQt5/Qt/lib/libQt5Core.so.5(_ZN20QEventDispatcherGlib13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE+0x5f)[0x7fb7cb31abaf]
/home/datawork/.virtualenvs/datawork/lib/python3.6/site-packages/PyQt5/Qt/plugins/platforms/../../lib/libQt5XcbQpa.so.5(+0xd89a1)[0x7fb7c066e9a1]
/home/datawork/.virtualenvs/datawork/lib/python3.6/site-packages/PyQt5/Qt/lib/libQt5Core.so.5(_ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE+0xea)[0x7fb7cb2c526a]
/home/datawork/.virtualenvs/datawork/lib/python3.6/site-packages/PyQt5/Qt/lib/libQt5Core.so.5(_ZN16QCoreApplication4execEv+0x84)[0x7fb7cb2cdda4]
/home/datawork/.virtualenvs/datawork/lib/python3.6/site-packages/PyQt5/QtWidgets.so(+0x1f73e0)[0x7fb7cc9ac3e0]
/lib64/libpython3.6m.so.1.0(_PyCFunction_FastCallDict+0x198)[0x7fb7d987a8b8]
/lib64/libpython3.6m.so.1.0(+0x12d1e3)[0x7fb7d98f01e3]
/lib64/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x1235)[0x7fb7d98f1ba5]
/lib64/libpython3.6m.so.1.0(+0x12c460)[0x7fb7d98ef460]
/lib64/libpython3.6m.so.1.0(_PyFunction_FastCallDict+0x276)[0x7fb7d98f9396]
/lib64/libpython3.6m.so.1.0(_PyObject_FastCallDict+0x17e)[0x7fb7d9830b7e]
/lib64/libpython3.6m.so.1.0(+0x19480e)[0x7fb7d995780e]
/lib64/libpython3.6m.so.1.0(PyObject_Call+0x6a)[0x7fb7d983092a]
/lib64/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0xd6f)[0x7fb7d98f16df]
/lib64/libpython3.6m.so.1.0(+0x12cdc5)[0x7fb7d98efdc5]
/lib64/libpython3.6m.so.1.0(PyEval_EvalCodeEx+0x6d)[0x7fb7d98f02fd]
/lib64/libpython3.6m.so.1.0(+0x98c43)[0x7fb7d985bc43]
/lib64/libpython3.6m.so.1.0(PyObject_Call+0x6a)[0x7fb7d983092a]
/lib64/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0xd6f)[0x7fb7d98f16df]
/lib64/libpython3.6m.so.1.0(+0x12c460)[0x7fb7d98ef460]
/lib64/libpython3.6m.so.1.0(+0x12d176)[0x7fb7d98f0176]
/lib64/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x1235)[0x7fb7d98f1ba5]
/lib64/libpython3.6m.so.1.0(+0x12c460)[0x7fb7d98ef460]
/lib64/libpython3.6m.so.1.0(+0x12d176)[0x7fb7d98f0176]
/lib64/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x1235)[0x7fb7d98f1ba5]
/lib64/libpython3.6m.so.1.0(+0x12c460)[0x7fb7d98ef460]
/lib64/libpython3.6m.so.1.0(+0x12d176)[0x7fb7d98f0176]
/lib64/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x1235)[0x7fb7d98f1ba5]
/lib64/libpython3.6m.so.1.0(+0x12c460)[0x7fb7d98ef460]
/lib64/libpython3.6m.so.1.0(_PyFunction_FastCallDict+0x276)[0x7fb7d98f9396]
/lib64/libpython3.6m.so.1.0(_PyObject_FastCallDict+0x17e)[0x7fb7d9830b7e]
/lib64/libpython3.6m.so.1.0(_PyObject_Call_Prepend+0xce)[0x7fb7d9830dae]
/lib64/libpython3.6m.so.1.0(PyObject_Call+0x6a)[0x7fb7d983092a]
/lib64/libpython3.6m.so.1.0(+0xcf900)[0x7fb7d9892900]
/lib64/libpython3.6m.so.1.0(+0xcc123)[0x7fb7d988f123]
/lib64/libpython3.6m.so.1.0(_PyObject_FastCallDict+0x8b)[0x7fb7d9830a8b]
/lib64/libpython3.6m.so.1.0(+0x12d0c4)[0x7fb7d98f00c4]
/lib64/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x1235)[0x7fb7d98f1ba5]
/lib64/libpython3.6m.so.1.0(+0x12c460)[0x7fb7d98ef460]
/lib64/libpython3.6m.so.1.0(+0x12d176)[0x7fb7d98f0176]
/lib64/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x1235)[0x7fb7d98f1ba5]
/lib64/libpython3.6m.so.1.0(+0x12c460)[0x7fb7d98ef460]
/lib64/libpython3.6m.so.1.0(+0x12d176)[0x7fb7d98f0176]
/lib64/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x1235)[0x7fb7d98f1ba5]
/lib64/libpython3.6m.so.1.0(+0x12c460)[0x7fb7d98ef460]
/lib64/libpython3.6m.so.1.0(+0x12d176)[0x7fb7d98f0176]
/lib64/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x1235)[0x7fb7d98f1ba5]
/lib64/libpython3.6m.so.1.0(+0x12c460)[0x7fb7d98ef460]
/lib64/libpython3.6m.so.1.0(+0x12d176)[0x7fb7d98f0176]
/lib64/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x1235)[0x7fb7d98f1ba5]
/lib64/libpython3.6m.so.1.0(+0x12c460)[0x7fb7d98ef460]
======= Memory map: ========
00400000-00401000 r-xp 00000000 fd:03 298                                /home/datawork/.virtualenvs/datawork/bin/python3.6
00601000-00602000 r--p 00001000 fd:03 298                                /home/datawork/.virtualenvs/datawork/bin/python3.6
00602000-00603000 rw-p 00002000 fd:03 298                                /home/datawork/.virtualenvs/datawork/bin/python3.6
01ab7000-02784000 rw-p 00000000 00:00 0                                  [heap]
02784000-1fee9000 rw-p 00000000 00:00 0                                  [heap]
7fb6747d4000-7fb6b47d5000 rw-p 00000000 00:00 0 
7fb6d47d1000-7fb6dc7d2000 rw-p 00000000 00:00 0 
7fb6dc7d2000-7fb6e47d3000 rw-p 00000000 00:00 0 
7fb6ebfdb000-7fb6f3fdc000 rw-p 00000000 00:00 0 
7fb6f3fdc000-7fb6f5fdc000 rw-p 00000000 00:00 0 
7fb6f5fdc000-7fb6f5fdd000 ---p 00000000 00:00 0 
7fb6f5fdd000-7fb6f67dd000 rw-p 00000000 00:00 0 
7fb6f67dd000-7fb6f67de000 ---p 00000000 00:00 0 
7fb6f67de000-7fb6f6fde000 rw-p 00000000 00:00 0 
7fb6f6fde000-7fb6f6fdf000 ---p 00000000 00:00 0 
7fb6f6fdf000-7fb6f77df000 rw-p 00000000 00:00 0 
7fb6f77df000-7fb6f77e0000 ---p 00000000 00:00 0 
7fb6f77e0000-7fb6f7fe0000 rw-p 00000000 00:00 0 
7fb6f7fe0000-7fb6f7fe1000 ---p 00000000 00:00 0 
7fb6f7fe1000-7fb6f87e1000 rw-p 00000000 00:00 0 
7fb6f87e1000-7fb6f87e2000 ---p 00000000 00:00 0 
7fb6f87e2000-7fb6f8fe2000 rw-p 00000000 00:00 0 
7fb6f8fe2000-7fb6f8fe3000 ---p 00000000 00:00 0 
7fb6f8fe3000-7fb6f97e3000 rw-p 00000000 00:00 0 
7fb6f97e3000-7fb6f97e4000 ---p 00000000 00:00 0 
7fb6f97e4000-7fb6f9fe4000 rw-p 00000000 00:00 0 
7fb6f9fe4000-7fb6f9fe5000 ---p 00000000 00:00 0 Check queue from GUI is empty
<queue.Queue object at 0x7fb71e429390>
True
Check queue from GUI is empty
<queue.Queue object at 0x7fb71e429390>
True
Check queue from GUI is empty
<queue.Queue object at 0x7fb71e429390>
True
Check queue from GUI is empty
<queue.Queue object at 0x7fb71e429390>
True
Check queue from GUI is empty
<queue.Queue object at 0x7fb71e429390>
True
Traceback (most recent call last):
  File "run_gui.py", line 235, in <module>
    *tasks
  File "/usr/lib64/python3.6/asyncio/base_events.py", line 467, in run_until_complete
    return future.result()
concurrent.futures.process.BrokenProcessPool: A process in the process pool was terminated abruptly while the future was running or pending.


how to run children UI?

I have main ui, and want to run children ui on click in main ui.
children:
`class sessionGenerator(QtWidgets.QMainWindow, designTg.Ui_MainWindow2):

def __init__(self, parent):

    print(parent)

    super(sessionGenerator, self).__init__(parent)

    self.setupUi(self)

    self.showHelp.clicked.connect(self.showHelpFull)

    self.next_1.clicked.connect(self.nextOne)

    self.next_2.clicked.connect(self.nextTwo)

    self.next_3.clicked.connect(self.nextThree)

....................................................`

if I use
`app2 = QtWidgets.QApplication(sys.argv)

        window2 = sessionGenerator()

        window2.show()

        app2.exec_()`

it appears on a second and throws 0xC0000005

just sessionGenerator runs great itself. But i can't figure out how to run it from another ui

Explain how to build the DLLs from source

Thank you for providing these DLLs.

Would it be possible to provide additional information on how to re-create them from the Qt5 community source code?

More precisely, I faced this problem when trying to compile them myself: Python2.7 is requiring a build with Visual C++ 9.0 (as stated in the WindowsCompilers Python wiki page), and Qt5 uses the C++ 2010 syntax which is not supported by Visual C++ 9.0.

What magic did you use to bypass this contradiction? Would it be a good idea to add this information in the README?

This is a BUG or NOT?

When I used PyQt5 to create a drop-down list box,I chose cancle but it still return that str type.I think it should return nothing.

PyQt 5.9

hello ; is it possible to create the last version because it solve some bugs in mediaplayer

64-bit vs 32-bit

In some cases on Windows, I get this error:
"The binaries distributed wtih this version are for the 64-bit version of Python only."

I'm confused, because I'm fairly certain the python I was running is 64-bit. Having said that, do you have a version that will work with 32-bit Python? It's likely on some Windows I may need to support that.

Thanks!

Superseded by official PyQt5 wheels?

Hey! I think this project was very useful back when PyQt5 didn't have official Windows wheels (thank you!), but I wonder if it's still needed? I can see various issues with it:

  • People report PyQt/Qt bugs here because it sounds like an official PyQt thing.
  • People find it on PyPI instead of the official PyQt5 and install it, and then either get an ancient Qt 5.3, or run into problems because of it not working (in the #pyqt IRC channel, we spent around 5h with someone having a "The specified procedure could not be found." error when importing PyQt5.QtCore, and it was really hard to find out that they didn't in fact install the official PyQt5).

So I wonder if there's still a reason for this to exist I'm missing? If not, maybe it should at the very least be deleted from PyPI, as Qt 5.3 is insecure, buggy, and in general not very useful nowadays?

Also, in either case, I think it would make everyone's life easier if this was clearly marked as unofficial and pointing to the official way to install PyQt via pip too.

Cross-platform

python-qt5 is currently distributed as a source distribution, which means that it won't distinguish between platforms when installing via pip. However as the included binaries are for Windows-only, they will fail on any other platform.

One alternative is to instead provide it as a source-distribution, but doing so would mean distributing from each platform individually; such as from Windows, OSX and potentially Linux (Ubuntu, initially) which means we can no longer use Travis and therefore not automatically distribute, as we are currently, as Travis only runs on Linux (and potentially OSX).

Another alternative is to bundle each platform into one big package, and decide at run-time which binaries to import, such as via __init__.py. This works, although as the binaries are 50mb+ would incur as rather large cost to disk-space and download time.

cannot find pyuic5.bat

Hi there,I've been using python27 for several days to do a homework,Im new to it and then my teacher asked me to add a GUI for my program,by PyQt,I looked up on the riverbank website and learned that binary wheel was only for python35 and above, build and install SIP and PYQT5 was too complex for me and I found this,using pip install python-qt5, I successfully installed pyqt5,but when I did as the reference "pycuic5 xx.ui ",it didnt work,and I didnt find the pyuic5 in the python27/scripts folder either.

how can I fix it?
and is there anything else that's different from the "offical installation"?

thanks very much!

qprinter.h

Upon compiling PyQt5, midway through it raised an error stating that qprinter.h was missing.

image

  • Windows 8.1 x64
  • Python 2.7.7 x64
  • VC2013 x64

Solution

I managed to resolve the issue by copying qprinter.h and qprinter.cpp from `QtPrinterSupport into QtGui, getting a hint from here:

Though a more permanent (and robust?) solution may be to actually update the configure.py

import QApplication not working on x64

running the pip version, 0.1.8 and the suggested test code:

>>>from PyQt5 import QtWidgets
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: DLL load failed: The specified module could not be found.

should I have done any preparation before running the pip command?

QtWebEngineWidgets not found after update from 5.10.1

I just updated my pyqt5 version to 5.11.3 and started getting a module not found error when trying to import QTWebEngine Widgets using from PyQt5.QtWebEngineWidgets import *. Upon reversion to 5.10.1 is started working again. This is on Python 3.6 running on Windows 10.

Was there a change to QtWebEngineWidgets between those versions and if so what should I use to import and use web engine functions now? There's been so many changes to the QTWebEngine that it's hard to track what is relevant to more recent versions.

pip install error

No files/directories in /tmp/pip-build-vOCnC2/python-qt5/pip-egg-info (from PKG-INFO)
What I missed ?

QFlags DeprecationWarning under Python 3.8

The following code prints out DeprecationWarning: an integer is required (got type DockOptions). Implicit conversion to integers using __int__ is deprecated, and may be removed in a future version of Python when run under Python 3.8:

import sys

from PyQt5.QtWidgets import (
    QApplication,
    QMainWindow,
)


app = QApplication(sys.argv)
w = QMainWindow(dockOptions=QMainWindow.AllowNestedDocks | QMainWindow.AnimatedDocks)
w.show()
sys.exit(app.exec_())

The deprecation is explained in "What’s New In Python 3.8", Build and C API Changes, the bullet point about PyLong_AsLong

For reference, I was using PyQt5 5.13.1 installed as wheel from PyPi under Python3.8 from Ubuntu 19.10's stock apt repositories.

QPyDesignerTaskMenuExtension doesn't work

Item doesn't show in menu :(


"""
AnalogViewPlugin.py

"""

from PyQt5.QtGui import QIcon
from PyQt5.QtCore import pyqtSlot
from PyQt5.QtWidgets import QAction 
from PyQt5.QtDesigner import (QDesignerFormWindowInterface, QExtensionFactory,
        QPyDesignerContainerExtension, QPyDesignerCustomWidgetPlugin,
        QPyDesignerPropertySheetExtension, QPyDesignerTaskMenuExtension)


from analogview import AnalogView



class GeoLocationMenuEntry(QPyDesignerTaskMenuExtension):

    def __init__(self, obj, parent):
        QPyDesignerTaskMenuExtension.__init__(self, parent)
        self.editStateAction = QAction('My script...', self)
        self.editStateAction.clicked.connect(self.setPV)

    def preferredEditAction(self):
        return self.editStateAction

    def taskActions(self):
        return [self.editStateAction]

    @pyqtSlot()
    def setPV(self):
        pass

class GeoLocationTaskMenuFactory(QExtensionFactory):

    def __init__(self, parent=None):

       QExtensionFactory.__init__(self, parent)


    def createExtension(self, obj, iid, parent):

        if iid != "com.trolltech.Qt.Designer.TaskMenu":
            return None

        if isinstance(obj, AnalogView):
            return GeoLocationMenuEntry(obj, parent)

        return None


########################


class AnalogViewPlugin(QPyDesignerCustomWidgetPlugin):
    """AnalogViewPlugin(QPyDesignerCustomWidgetPlugin)

    Provides a Python custom plugin for Qt Designer by implementing the
    QDesignerCustomWidgetPlugin via a PyQt-specific custom plugin class.
    """

    # The __init__() method is only used to set up the plugin and define its
    # initialized variable.
    def __init__(self, parent=None):

        super(AnalogViewPlugin, self).__init__(parent)

        self.initialized = False

    def initialize(self, formEditor):

        if self.initialized:
            return
        manager = formEditor.extensionManager()
        if manager:
            self.factory = GeoLocationTaskMenuFactory(manager)
            manager.registerExtensions(self.factory, "com.trolltech.Qt.Designer.TaskMenu")
        self.initialized = True

    def isInitialized(self):

        return self.initialized

    # This factory method creates new instances of our custom widget with the
    # appropriate parent.
    def createWidget(self, parent):
        widget = AnalogView(parent)
        # widget.setValue(1)
        return widget

    # This method returns the name of the custom widget class that is provided
    # by this plugin.
    def name(self):
        return "AnalogView"

    # Returns the name of the group in Qt Designer's widget box that this
    # widget belongs to.
    def group(self):
        return "SCADA"

    # Returns the icon used to represent the custom widget in Qt Designer's
    # widget box.
    def icon(self):
        return QIcon()

    # Returns a short description of the custom widget for use in a tool tip.
    def toolTip(self):
        return ""

    # Returns a short description of the custom widget for use in a "What's
    # This?" help message for the widget.
    def whatsThis(self):
        return ""

    # Returns True if the custom widget acts as a container for other widgets;
    # otherwise returns False. Note that plugins for custom containers also
    # need to provide an implementation of the QDesignerContainerExtension
    # interface if they need to add custom editing support to Qt Designer.
    def isContainer(self):
        return False

    # Returns an XML description of a custom widget instance that describes
    # default values for its properties. Each custom widget created by this
    # plugin will be configured using this description.
    def domXml(self):
        return '<widget class="AnalogView" name="analogView" />\n'

    # Returns the module containing the custom widget class. It may include
    # a module path.
    def includeFile(self):
        return "analogview"

problem with sip

hello ; i use pyinstaller to compile scripts and always i got error that no module named sip
as i know pyqt5 install sip automatically but with this version always the original and old one detected and there is no new version for python 2.7

Cannot install from git via pip

To start, I should mention, I believe I specifically need to install from git rather than pip since I had problems getting pyinstaller working with PyQt5 otherwise.

I'd like to be able to improve my build process by having the install go through a requirements.txt file.

However, it seems I am unable to put this in my requirements.txt:
git+git://github.com/pyqt/python-qt5.git

That is, on Windows, I get this error:
"No files/directories in "

The internet says this is because it's not a python package?

Any suggestions?
Thanks!

Inheriting from QWebEnginePage, won't run in a loop, what am I doing wrong?

Hi,

I'm trying to run this snippet on Manjaro linux, Python 3.7.2, PyQt 5.12.2:

import sys
from PyQt5.QtWebEngineWidgets import QWebEnginePage
from PyQt5.QtWidgets import QApplication
from PyQt5.QtCore import QUrl
from time import sleep


class Page(QWebEnginePage):
    def __init__(self, url):
        self.app = QApplication(sys.argv)
        QWebEnginePage.__init__(self)
        self.html = ''
        self.loadFinished.connect(self._on_load_finished)
        self.load(QUrl(url))
        self.app.exec_()


    def _on_load_finished(self):
        sleep(7)
        self.html = self.toHtml(self.Callable)
        print('Load finished')


    def Callable(self, html_str):
        self.html = html_str
        self.app.quit()


for _ in range(4):
    Page('https://www.bbc.com/')

I get 2 iterations and then:

.
.
.
Received signal 11 SEGV_MAPERR 000000000250
.
.

However, if I paste the same code to say 10 different files, with:
Page('https://www.bbc.com/')
instead of a loop, and run them, it works fine.

Pardon my noobness, but why won't it work in a loop?

Thanks

Directory cannot be chosen with DirectoryOnly file mode in QFileDialog

Only Directory which has name with dot (".") can be chosen.

qfiledialog.py

if __name__ == '__main__':
    from PyQt5.QtWidgets import QFileDialog, QApplication
    import sys
    app = QApplication(sys.argv)

    file_dialog = QFileDialog(None, "Select Directory Data", "", 'All Files(*.*)')
    file_dialog.setFileMode(QFileDialog.DirectoryOnly)

    dir_name = ""
    if file_dialog.exec_():
        dir_name = file_dialog.selectedFiles()[0]

    sys.exit(app.exec_())

System and software versions:

  • Ubuntu 18.04.3 LTS
  • Python 3.6.8
  • PyQt5 5.13.1

I run the qfiledialog.py in virtual environment with only PyQt5 installed manually. The file dialog pops up and the appearance is as the following. But as you see only the directory "with_dot." is in black color and can be chosen. But directory "test_directory" does not.
Screenshot from 2019-10-23 15-52-45

I tried to run it with superuser command (sudo). All directory works fine right now. But I guess it is not expected to be only worked with root privilege. I also check the file permissions. I suspect nothing related to the directory's file permissions since directory "with_dot." and "test_directory" have identical status of the permission.
Screenshot from 2019-10-23 16-11-18

"class ProxyBase(metaclass=ProxyMetaclass)" invalid syntax

I have Python 2.7.14 installed.
When I installed python-qt5 and executed python setup.py install, I got this error:

byte-compiling build\bdist.win-amd64\egg\PyQt5\uic\port_v3\proxy_base.py to proxy_base.pyc
File "build\bdist.win-amd64\egg\PyQt5\uic\port_v3\proxy_base.py", line 26
class ProxyBase(metaclass=ProxyMetaclass):
SyntaxError: invalid syntax

But the test on Wiki can still be passed. I had also checked proxy_base.py mentioned above, but couldn't find a way to solve it.

So how can I fix this error? Thanks in advance!

Could not find QtWebEngineProcess.exe

i follow the wiki build qt5.7.1 on vs2015
everything is fine
but QWebEngineView
simple code

import sys

from PyQt5.QtWidgets import QApplication
from PyQt5.QtWidgets import QMainWindow
from PyQt5.QtWebEngineWidgets import QWebEngineView
from PyQt5.QtCore import QUrl
def main():
    app = QApplication(sys.argv)
    window = QMainWindow()
    window.setWindowTitle('PyQt Demo')
    window.setGeometry(320, 180, 960, 540)
    view = QWebEngineView()
    view.load(QUrl('http://leafletjs.com/')) # error here
    window.setCentralWidget(view)
    window.show()
    sys.exit(app.exec_())
if __name__ == '__main__':
    main()

and display
Could not find QtWebEngineProcess.exe
how to solve this
thanks

ModuleNotFoundError: No module named 'util'

When I try to install python-qt5 and I do:

python -c "import util;util.createqtconf()"

In the windows cmd I get the error:

Traceback (most recent call last): File "<string>", line 1, in <module> ModuleNotFoundError: No module named 'util'

How can I solve this?
Thanks for reading!

pylupdate5 fail to extract translated string on black formatted code

pylupdate5 v5.14.2

My code use black as the unique code formatter.

Black add a trailing comma after some strings.
Sadly, pylupdate5 do not extract those strings.

Workaround (painful):
Manually remove the trailing commas on each strings, extract strings with pylupdate5, then reformat with black.

Example:

This code is not extracted... Remove comma and it will.

    _DESCRIPTION_STR_ = QT_TRANSLATE_NOOP(
        "PercentOfAverage",
        """Percent of Average referential of the money.<br />
                                          Percent of Average value PoA is calculated by dividing the quantitative value Q by the average<br />
                                           then multiply by one hundred.<br />
                                          This referential is relative and more reliable to display prices and accounts, when UD is two low.<br />
                                          No money creation or destruction is apparent here and every account tend to<br />
                                           the average.
                                          """,
    )

QQmlApplicationEngine failed to load component

QML isn't being picked up.

The issue is resolved by creating a qt.conf file at c:\Python27 with this content:

[Paths]
Prefix = C:/Python27/Lib/site-packages/PyQt5

I'd ideally keep everything within the PyQt5 package, but at least there is a simple solution available. Is there an environment variable available for Prefix?

Qt platform plugin "windows"

Cannot instantiate a QApplication.

import sys
from PyQt5 import QtWidgets

app = QtWidgets.QApplication(sys.argv)

Results in:

This application failed to start because it could not find or load the Qt platfo
rm plugin "windows".

Available platform plugins are: minimal (from C:\Python27\lib\site-packages\PyQt
5\plugins\platforms), offscreen (from C:\Python27\lib\site-packages\PyQt5\plugin
s\platforms), windows (from C:\Python27\lib\site-packages\PyQt5\plugins\platform
s).

Reinstalling the application may fix this problem.

Having encountered the problem in the past, I could solve it by appending the plugins by hand like this:

import os
import sys

import PyQt5

dirname = os.path.dirname(PyQt5.__file__)
plugin_path = os.path.join(dirname, 'plugins', 'platforms')
os.environ['QT_QPA_PLATFORM_PLUGIN_PATH'] = plugin_path

from PyQt5 import QtWidgets
app = QtWidgets.QApplication(sys.argv)

However this produces the same error. The odd thing is that it says it can't load the plugin, and then lists the plugin as one of the available ones. Maybe a permission issue? Yet permissions on the files are unlocked and even replacing it with the source original from the Qt installation yields the same results. Removing the plugin from the directory correctly removes it from plugins found.

depends.exe

Running depends on qwindows.dll yields a few interesting results.

depends

However each of these are available directly within the PyQt5 Python package directory.

It works

If keeping the original installation of Qt on the PATH, PyQt5 seems to work. From a terminal:

# Keeping C:\Qt\Qt5.3.0\5.3\msvc2013_64\bin on the PATH

import os
import sys

from PyQt5 import QtWidgets
app = QtWidgets.QApplication(sys.argv)
button = QtWidgets.QPushButton("Hello World")
button.show()

So there must be something within this directory which is requited by PyQt5. But copying the entire contents into the PyQt5 Python library directory yields no better results.

pip+git should read pip+http

Hi, I am a newbe in python. There is a line in readme that says to install python-qt5 with the following command:
pip install git+git://github.com/pyqt/python-qt5.git

it should read:
pip install git+http://github.com/pyqt/python-qt5.git

It worked for after several minutes

stateChanged is not being called when moving PolyLineROI

I tried to print the new coordinates of the handles of a PolyLineROI when I drag it to a new positions.
The signal sigRegionChangeFinished signal is emitted but the stateChanged function is not called such that the positions of the handles are not updated:

self.grid_box = pg.PolyLineROI(pos, closed=True, movable=True)
self.grid_box.sigRegionChangeFinished.connect(self._print_points)
self.refine_btn.setEnabled(True)
def _print_points(self):
     points_obj = self.grid_box.getState()['points']
     points = np.array([list((point[0], point[1])) for point in points_obj])
     print('Points: \n', points)

Points:
[[2127.82468485 34.86386885]
[2472.39864298 412.93394575]
[ 552.62944768 469.88173976]
[ 257.28034072 106.04861136]]
Points:
[[2127.82468485 34.86386885]
[2472.39864298 412.93394575]
[ 552.62944768 469.88173976]
[ 257.28034072 106.04861136]]

If I move each handle independently the positions are updated correctly...

Saving and restoring a PyQt Application state ?

I have developed a PyQt4 application , and it has a stacked widget structure where each widget in the stacked-widget is described by a separate class , when I started trying out to save the state of the application , I was unable to find any , there was a QDataStream which sounded promising but I would have to manually save each PyQt element's state and settings , is there a better and more elegant way ? Thanks .

QML Not working

Hello! I have a problem with qml: i can't start my app on python2.7.
This is my python code main.py:

from PyQt5.QtCore import QUrl, QObject, pyqtSlot
from PyQt5.QtGui import QGuiApplication
from PyQt5.QtQuick import QQuickView

if __name__ == '__main__':
    import sys

    app = QGuiApplication(sys.argv)

    view = QQuickView()
    view.setResizeMode(QQuickView.SizeRootObjectToView)
    view.setSource(
        QUrl.fromLocalFile('main.qml')
    )
    view.show()

    sys.exit(app.exec_())

and qml code main.qml:

import QtQuick 2.0

Rectangle {
    width: 500
    height: 400
}

Bundle qt.conf

At the moment, the only file keeping PyQt5 from being fully insulated and portable is the qt.conf that is installed in the root of your Python directory.

According to this, it should be possible to bundle it via Qt's resource system, by importing the resource when importing PyQt5 for the first time. In it's __init__.py.

Support for QtWebEngineWidgets in Windows PyQt5

Hi,
It seems that this may only be available in Qt5.6 or later, but I haven't completely determined that. This module seems to be completely missing when I try to build my Windows app using your python-qt5.
Any guidance on this?
Thanks!

Installing Bug? (designer and pyuic.bat)

Hi,
i try to install PyQt5 but it will not work.

I testes
pip3 install pyqt5 but than there is no designer.exe (and no pyuic5.bat)

pip install python-qt5 there is a a designer.exe (but no pyuic5.bat)
When i start the designer.exe i get a error:

This application failed to start because it could not find or load the Qt platform plugin "windows".
Reinstalling the applictaion may fiy this problem.

I think this is cause its for installation on Python 2.7?

I run Python 3.6

So, which is the right way to install PyQt5 on Python 3.6 with designer and uic.bat?

I hope u can help

Pycharm: QStandardItemModel and QStandardItem

When i write:
from PyQt5.QtGui import QStandardItemModel
it doesnt find it and
self.list_model.appendRow(QStandardItem(text))
Don't find QStandardItem

all in pycharm, compiling it works fine.

pyrcc5 is missing

I noticed that pyrcc5.exe in not installed. But it is compiled and in the repository.
Great job anyway saved me a lots of time

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.