PyQt Executable does nothing

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

PyQt Executable does nothing

alan moore

Hello,

I've got a bare bones demo program that I'm trying to package using PyInstaller.

The directory layout looks like this:

qttest/
├── qttest
│  └── __init__.py
└── qttest.py

The qttest.py file looks this:

from qttest import main

main()

qttest.__init__.py looks like this:

from PyQt5 import QtWidgets as qtw

def main():
    app = qtw.QApplication([])

    w = qtw.QPushButton('Hi There')
    w.show()
    app.exec()

When I run the program using Python, it works fine, and shows a button saying 'Hi There'.

When I run pyinstaller qttest.py, it seems to find all the dependencies just fine and generates an executable; however, when I run the resulting executable, nothing happens. No errors, and no button. The program just exits immediately.

I've tried this on both Linux and Windows 10 using the version of PyInstaller on PyPI. What am I doing wrong?

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: PyQt Executable does nothing

alan moore
I figured out the problem here.  If I change the name of qttest.py to anything else, it works fine.  It appears having the launch script and library share the same name confuses PyInstaller in some way.  Is this a known issue? By design?  Or  a bug?

On 5/3/19 11:58 PM, alan moore wrote:

Hello,

I've got a bare bones demo program that I'm trying to package using PyInstaller.

The directory layout looks like this:

qttest/
├── qttest
│  └── __init__.py
└── qttest.py

The qttest.py file looks this:

from qttest import main

main()

qttest.__init__.py looks like this:

from PyQt5 import QtWidgets as qtw

def main():
    app = qtw.QApplication([])

    w = qtw.QPushButton('Hi There')
    w.show()
    app.exec()

When I run the program using Python, it works fine, and shows a button saying 'Hi There'.

When I run pyinstaller qttest.py, it seems to find all the dependencies just fine and generates an executable; however, when I run the resulting executable, nothing happens. No errors, and no button. The program just exits immediately.

I've tried this on both Linux and Windows 10 using the version of PyInstaller on PyPI. What am I doing wrong?

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: PyQt Executable does nothing

Raoul Snyman
Ah yes, I ran into this with my app. Technically your starting script should have a different name to your "library" - remember that in Python a file or a directory is a module. So in your case you have two modules, both named "qttest" and this is confusing Python.

So while you ran into this issue with PyInstaller, it's really more of a broader naming conflict issue. 

On Sun, May 5, 2019, 02:30 alan moore <[hidden email]> wrote:
I figured out the problem here.  If I change the name of qttest.py to anything else, it works fine.  It appears having the launch script and library share the same name confuses PyInstaller in some way.  Is this a known issue? By design?  Or  a bug?

On 5/3/19 11:58 PM, alan moore wrote:

Hello,

I've got a bare bones demo program that I'm trying to package using PyInstaller.

The directory layout looks like this:

qttest/
├── qttest
│  └── __init__.py
└── qttest.py

The qttest.py file looks this:

from qttest import main

main()

qttest.__init__.py looks like this:

from PyQt5 import QtWidgets as qtw

def main():
    app = qtw.QApplication([])

    w = qtw.QPushButton('Hi There')
    w.show()
    app.exec()

When I run the program using Python, it works fine, and shows a button saying 'Hi There'.

When I run pyinstaller qttest.py, it seems to find all the dependencies just fine and generates an executable; however, when I run the resulting executable, nothing happens. No errors, and no button. The program just exits immediately.

I've tried this on both Linux and Windows 10 using the version of PyInstaller on PyPI. What am I doing wrong?

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: PyQt Executable does nothing

alan moore
You make a good point, but yet I see this kind of naming scheme recommended and used a lot. Guess that advice needs to change.

On May 5, 2019 10:55:39 AM CDT, Raoul Snyman <[hidden email]> wrote:
Ah yes, I ran into this with my app. Technically your starting script should have a different name to your "library" - remember that in Python a file or a directory is a module. So in your case you have two modules, both named "qttest" and this is confusing Python.

So while you ran into this issue with PyInstaller, it's really more of a broader naming conflict issue. 

On Sun, May 5, 2019, 02:30 alan moore <[hidden email]> wrote:
I figured out the problem here.  If I change the name of qttest.py to anything else, it works fine.  It appears having the launch script and library share the same name confuses PyInstaller in some way.  Is this a known issue? By design?  Or  a bug?

On 5/3/19 11:58 PM, alan moore wrote:

Hello,

I've got a bare bones demo program that I'm trying to package using PyInstaller.

The directory layout looks like this:

qttest/
├── qttest
│  └── __init__.py
└── qttest.py

The qttest.py file looks this:

from qttest import main

main()

qttest.__init__.py looks like this:

from PyQt5 import QtWidgets as qtw

def main():
    app = qtw.QApplication([])

    w = qtw.QPushButton('Hi There')
    w.show()
    app.exec()

When I run the program using Python, it works fine, and shows a button saying 'Hi There'.

When I run pyinstaller qttest.py, it seems to find all the dependencies just fine and generates an executable; however, when I run the resulting executable, nothing happens. No errors, and no button. The program just exits immediately.

I've tried this on both Linux and Windows 10 using the version of PyInstaller on PyPI. What am I doing wrong?

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/d/optout.


--
Sent from my Android device with K-9 Mail. Please excuse my brevity.

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/d/optout.