[Python] PyInstaller Executable Producing Unexpected Loop Output on Mac M1

Discussão em 'Python' iniciado por Stack, Fevereiro 26, 2025.

  1. Stack

    Stack Membro Participativo

    i try to run the following code on my computers:

    from yahooquery import Ticker
    inpStocks = ["a", "b", "c", "d", "e", "f"]
    for rowNum, stock in enumerate(inpStocks):
    print (f"Read data for {stock} in row {rowNum}...")
    yqData = Ticker(stock)
    if stock not in yqData.price:
    print("Stock not in price-info")


    I am creating an executable program using pyinstaller with this command:

    pyinstaller --onefile test.py


    When i run this python-code directly (on Windows or Mac) and also the executable program on Windows i get an output as expected in that way:

    (3_10) C:\DEVNEU\Fiverr2025\ORDER\VanaromHuot>python test.py
    Read data for a in row 0...
    Read data for b in row 1...
    Read data for c in row 2...
    Read data for d in row 3...
    Read data for e in row 4...
    Read data for f in row 5...


    But when i run the executable program on Mac i get a weird output in that way

    Last login: Wed Feb 26 11:24:49 on ttys001
    /Users/markus/Documents/DEV/Fiverr2025/ORDER/VanaromHuot/test ; exit;
    markus@Macmini ~ % /Users/markus/Documents/DEV/Fiverr2025/ORDER/VanaromHuot/test ; exit;
    Read data for a in row 0...
    Read data for b in row 1...
    Read data for a in row 0...
    Read data for c in row 2...
    Read data for b in row 1...
    Read data for a in row 0...
    Read data for d in row 3...
    Read data for c in row 2...
    Read data for b in row 1...
    Read data for a in row 0...
    Read data for e in row 4...
    Read data for b in row 1...
    Read data for c in row 2...
    Read data for a in row 0...
    Read data for f in row 5...
    Read data for d in row 3...
    Read data for d in row 3...
    Read data for c in row 2...

    Saving session...
    ...copying shared history...
    ...saving history...truncating history files...
    ...completed.

    [Prozess beendet]


    Why is this not working on Mac with the excecutable? Why is even such an output possible when you have a look at the for-loop in the code...? Has this probably something to do that my Mac has a M1 chipset? (Mac Mini 2020 M1) How can i run the above program on a M1 chipset if this is the problem?

    Continue reading...

Compartilhe esta Página