Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

It's great to be smart 'cause then you know stuff.


devel / comp.lang.python / For a hierarchical project, the EXE file generated by "pyinstaller" does not start.

SubjectAuthor
* For a hierarchical project, the EXE file generated by "pyinstaller"Mohsen Owzar
`* Re: For a hierarchical project, the EXE file generated byChris Angelico
 `- Re: For a hierarchical project, the EXE file generated byMohsen Owzar

1
For a hierarchical project, the EXE file generated by "pyinstaller" does not start.

<a1e1d8be-e2cc-4187-a600-01c2cbb3c8fbn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=16323&group=comp.lang.python#16323

  copy link   Newsgroups: comp.lang.python
X-Received: by 2002:a05:620a:b8b:: with SMTP id k11mr37710948qkh.746.1638853137877;
Mon, 06 Dec 2021 20:58:57 -0800 (PST)
X-Received: by 2002:ac8:5c8f:: with SMTP id r15mr45196736qta.465.1638853137710;
Mon, 06 Dec 2021 20:58:57 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.python
Date: Mon, 6 Dec 2021 20:58:57 -0800 (PST)
Injection-Info: google-groups.googlegroups.com; posting-host=31.165.67.106; posting-account=BtTavwoAAACMi3AFrA3U-JBERbxGUGhD
NNTP-Posting-Host: 31.165.67.106
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a1e1d8be-e2cc-4187-a600-01c2cbb3c8fbn@googlegroups.com>
Subject: For a hierarchical project, the EXE file generated by "pyinstaller"
does not start.
From: mohsen.o...@gmail.com (Mohsen Owzar)
Injection-Date: Tue, 07 Dec 2021 04:58:57 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 164
 by: Mohsen Owzar - Tue, 7 Dec 2021 04:58 UTC

Hi all,

I have a problem with "pyinstaller".
When I compile a single Python file, an EXE file is created in the "dist" directory, with which I can start the program and the GUI appears after a few seconds.
But when I try to compile my project with "pyinstaller Relais_LastDauerTester.py" and generate an EXE file from it, an ".exe" file is also created in the "dist" directory, but nothing happens when I run both .exe files from Windows Explorer with a double click or from the DOS shell by invoking it.
The mouse pointer changes briefly to an hourglass and then back and nothing happens.
The only difference between these two programs is that the first is just a single file and my project is structured hierarchically. I tried to demonstrate the structure of the project below with two "DIR" DOS commands.
In PyCharm you only need to run the top file "Relais_LastDauerTester.py", so I used this file for "pyinstaller".
But it looks like I have to give (I believe) an extra argument for a hierarchical project.
I googled all weekend to find a workable solution. But all I found was for converting a ".py" file and not a project like mine.
With some suggestions, I should add a "pause" or "input ()" command to the code to prevent the DOS shell from disappearing quickly, which is out of the question for me.
Do you have any idea what it could be?
I thank you in advance for any useful advice that could help me.

Greeting
Mohsen

PS
I work on a PC with
1201 INFO: PyInstaller: 4.7
1202 INFO: Python: 3.9.5
1282 INFO: Platform: Windows-10-10.0.18363-SP0

Project Structure from PyCharm
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
....\SW\Relais_LastDauerTester_V0.5
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
<DIR> .idea
<DIR> Logfiles
<DIR> Relais_LastDauerTester
276 Relais_LastDauerTester.py
<DIR> Screenshotfiles
405 settings.ini

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
....\SW\Relais_LastDauerTester_V0.5\Relais_LastDauerTester
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
9’308 GPIOControl.py
90’618 GUI_View.py
998 main.py
28’625 TestControl.py
269 __init__.py
<DIR> __pycache__

Simplified project files with the "import" lines *******************************************************************
Relais_LastDauerTester.py.py
*******************************************************************
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from Relais_LastDauerTester.main import main

if __name__ == "__main__":
main()

*******************************************************************
main.py
*******************************************************************
import sys

from PyQt5.QtCore import *
from PyQt5.QtWidgets import QApplication
from .GUI_View import MainWindow

def main():
app = QApplication(sys.argv)

window = MainWindow()
window.show()

sys.exit(app.exec_())

if __name__ == '__main__':
main()

*******************************************************************
GUI_View.py
*******************************************************************
import sys
import subprocess

import PyQt5.QtGui as qtg
from PyQt5.QtWidgets import (QLabel, QPushButton, QLineEdit, QCheckBox, QWidget,
QVBoxLayout, QHBoxLayout, QGridLayout, QDialog, QFileDialog)
from .TestControl import *

class MainWindow(QWidget):
def __init__(self):
super().__init__()

def createMainWindow(self):
....

def exitMainWindow(self):
....

def ChangeToPrefWindow(self):
self.prefwindow.show()
self.hide()

class PrefWindow(QWidget):
def __init__(self, parent=None):
super().__init__()
self.parent = parent
....
self.createPrefWindow()

def ChangeToMainWindow(self):
....

def createPrefWindow(self):
....

class CustomLineEdit(QLineEdit):
clicked = pyqtSignal()

def mousePressEvent(self, QMouseEvent):
self.clicked.emit()

class Keypad_Window_New(QDialog):
def __init__(self, num=0, parent=None):
super().__init__(parent)
self.parent = parent
....

TestContrl.py
*******************************************************************
from PyQt5.QtCore import *
from .GPIOControl import GPIOControl

class WorkerSignals(QObject):
signal_Update_Label = pyqtSignal()

class TestControl(QRunnable):
signals = WorkerSignals()

def __init__(self, parent=None):
super().__init__()
self.parent = parent
....

*******************************************************************
GPIOContrl.py
*******************************************************************
class GPIOControl:
def my_print(self, args):
if print_allowed == 1:
print(args)

def __init__(self):

Re: For a hierarchical project, the EXE file generated by "pyinstaller" does not start.

<mailman.34.1638900994.15287.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=16332&group=comp.lang.python#16332

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: ros...@gmail.com (Chris Angelico)
Newsgroups: comp.lang.python
Subject: Re: For a hierarchical project, the EXE file generated by
"pyinstaller" does not start.
Date: Wed, 8 Dec 2021 05:16:21 +1100
Lines: 19
Message-ID: <mailman.34.1638900994.15287.python-list@python.org>
References: <a1e1d8be-e2cc-4187-a600-01c2cbb3c8fbn@googlegroups.com>
<CAPTjJmqcqSTRmfSJpyGagh=ZcM--XGN9zVW7RoD8XKLg6QQ+9A@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de nhuQvgb+xVEfCoBs3GRMhQLzUQ4yMnj88bWjiJfvUMdQ==
Return-Path: <rosuav@gmail.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=gmail.com header.i=@gmail.com header.b=IWnIm1mc;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.018
X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'def': 0.04; 'windows,':
0.05; 'subject:not': 0.09; 'args):': 0.16; 'chrisa': 0.16;
'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16;
'received:209.85.221.54': 0.16; 'received:mail-
wr1-f54.google.com': 0.16; 'subject:does': 0.16; 'wrote:': 0.16;
'instead': 0.17; "can't": 0.17; 'to:addr:python-list': 0.20;
'skip:_ 10': 0.22; 'subject:file': 0.22; 'function': 0.27; 'dec':
0.31; 'question': 0.32; 'checks': 0.32; 'message-
id:@mail.gmail.com': 0.32; 'but': 0.32; 'printing': 0.34; 'header
:In-Reply-To:1': 0.34; 'received:google.com': 0.34;
'from:addr:gmail.com': 0.35; 'main': 0.37; 'received:209.85':
0.37; 'class': 0.37; 'received:209': 0.39; 'wed,': 0.39; 'pass':
0.64; 'your': 0.64; 'subject:For': 0.69; '2021': 0.71; 'allowed,':
0.84; 'itself.': 0.84; 'skip:* 60': 0.84
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
h=mime-version:references:in-reply-to:from:date:message-id:subject:to;
bh=sa0m4/pMiTDc30oAJBF8vNGeffuWnS+FK6n2s7ZiySs=;
b=IWnIm1mcWMJ96N5DElFYHkIHiBJJomaU1p2Z9mINf2XgMVRt6gT68FNjTXTfHs+o5A
SIZ86b4jNgu7dSwKJkNqvOiZb3PKWKw/6XSu38jGgF2BCuCv1Wgj/xMdWai7E7+3y3XL
bcwwGmED3sMBljQJRpT+EWctAG8dJ8jPFkoOY0X8D7vKm0SA6/jZjvy91xr/EnJhMc1F
GoIUsFm61K6ktgL/V6Ig2LKUkk4+knW3HKp7hMKDyePB1O2XMinF9NUQipQYz7qib8Ny
LC+CrufY7pGOVSED4Y3wcYzK5LuD7iqhrkGd1NI0XVLgUkYEp6fM3xDRT5vpEYlJMVT/
AlVw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112;
h=x-gm-message-state:mime-version:references:in-reply-to:from:date
:message-id:subject:to;
bh=sa0m4/pMiTDc30oAJBF8vNGeffuWnS+FK6n2s7ZiySs=;
b=tpP8mGfUyNRWHkJ62BHITc5xVLpvxEjYP8pVitRpWS9TNlOnLxauD9/0ILLcTm8QpX
mZgAK5WxuTax1fMXGJWYGeftkUgBFz2Z/3SU/wuXd6hSswueNHRhqtS/F7bEw3WKS0Fc
y7uuiNBPG7F5MmRiU26KPO4Sax3nUKe8n8yI9XPxmBYJuriR2zpZyLwJF82A2wgOVHhN
uuK35Ty6JgCuaY5yhrT1DsP23gEJC/FBwR4VKX1G84O7KB4IUh5U7h5dhXb3HgEvN/cu
cVH7L/DEySiiw/Z1L5c07Wh0QmiaoAjvwwVccqGImxbgXIyaRFSL/2bMHu3bUsYH84u9
Gk2A==
X-Gm-Message-State: AOAM530NAcVfd4JeK1pwtxgMfVxdxFzoqS+zbyFriRFMqxL79M2MfIan
K+dNxh8I+WFHSg9Dm1VLzbg9pj0EGre/+zRS9kHgzqAX
X-Google-Smtp-Source: ABdhPJzY2mNG5wZcfWRn9NKe6TuhFkreqVH1V9fwD3yYAbmzIINeZP8UwKgSDSxTngyqVHdN5st4vfTsVi6Oq+3qZNA=
X-Received: by 2002:adf:cf05:: with SMTP id o5mr53142514wrj.325.1638900992011;
Tue, 07 Dec 2021 10:16:32 -0800 (PST)
In-Reply-To: <a1e1d8be-e2cc-4187-a600-01c2cbb3c8fbn@googlegroups.com>
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.38
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <CAPTjJmqcqSTRmfSJpyGagh=ZcM--XGN9zVW7RoD8XKLg6QQ+9A@mail.gmail.com>
X-Mailman-Original-References: <a1e1d8be-e2cc-4187-a600-01c2cbb3c8fbn@googlegroups.com>
 by: Chris Angelico - Tue, 7 Dec 2021 18:16 UTC

On Wed, Dec 8, 2021 at 4:49 AM Mohsen Owzar <mohsen.owzar@gmail.com> wrote:
> *******************************************************************
> GPIOContrl.py
> *******************************************************************
> class GPIOControl:
> def my_print(self, args):
> if print_allowed == 1:
> print(args)
>
> def __init__(self):

Can't much help with your main question as I don't do Windows, but one
small side point: Instead of having a my_print that checks if printing
is allowed, you can conditionally replace the print function itself.

if not print_allowed:
def print(*args, **kwargs): pass

ChrisA

Re: For a hierarchical project, the EXE file generated by "pyinstaller" does not start.

<2abb9404-aa1e-45fc-b887-d97a0a837bf3n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=16340&group=comp.lang.python#16340

  copy link   Newsgroups: comp.lang.python
X-Received: by 2002:a05:6214:20e3:: with SMTP id 3mr5695434qvk.47.1638956410956;
Wed, 08 Dec 2021 01:40:10 -0800 (PST)
X-Received: by 2002:a05:6214:e47:: with SMTP id o7mr5923893qvc.61.1638956410833;
Wed, 08 Dec 2021 01:40:10 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.python
Date: Wed, 8 Dec 2021 01:40:10 -0800 (PST)
In-Reply-To: <mailman.34.1638900994.15287.python-list@python.org>
Injection-Info: google-groups.googlegroups.com; posting-host=31.165.67.106; posting-account=BtTavwoAAACMi3AFrA3U-JBERbxGUGhD
NNTP-Posting-Host: 31.165.67.106
References: <CAPTjJmqcqSTRmfSJpyGagh=ZcM--XGN9zVW7RoD8XKLg6QQ+9A@mail.gmail.com>
<a1e1d8be-e2cc-4187-a600-01c2cbb3c8fbn@googlegroups.com> <mailman.34.1638900994.15287.python-list@python.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2abb9404-aa1e-45fc-b887-d97a0a837bf3n@googlegroups.com>
Subject: Re: For a hierarchical project, the EXE file generated by
"pyinstaller" does not start.
From: mohsen.o...@gmail.com (Mohsen Owzar)
Injection-Date: Wed, 08 Dec 2021 09:40:10 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2198
 by: Mohsen Owzar - Wed, 8 Dec 2021 09:40 UTC

Chris Angelico schrieb am Dienstag, 7. Dezember 2021 um 19:16:54 UTC+1:
> On Wed, Dec 8, 2021 at 4:49 AM Mohsen Owzar <mohsen...@gmail.com> wrote:
> > *******************************************************************
> > GPIOContrl.py
> > *******************************************************************
> > class GPIOControl:
> > def my_print(self, args):
> > if print_allowed == 1:
> > print(args)
> >
> > def __init__(self):
> Can't much help with your main question as I don't do Windows, but one
> small side point: Instead of having a my_print that checks if printing
> is allowed, you can conditionally replace the print function itself.
>
> if not print_allowed:
> def print(*args, **kwargs): pass
>
> ChrisA

Thanks Chris
Your answer didn't help me to solve my problem, but gave me another idea to write a conditional print statement.

Regards
Mohsen

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor