mherrmann / fbs

Create Python GUIs with Qt in minutes
https://build-system.fman.io
GNU General Public License v3.0
3.8k stars 194 forks source link

"fbs freeze" does not work with the default program #291

Open Einmitt opened 1 year ago

Einmitt commented 1 year ago

I just bought the Pro Hobbyist version. I had written a Python+PyQt5 program (no other dependencies), could run it but not freeze it.

To test my setup I used "fbs startproject" to create the default program and had the excact same problem. The command "fbs run" opens the default window but "fbs freeze" returna an error message.

This is my setup: Op sys: macOS 12.6.2 Python: 3.9.1 fbs: 1.1.9 PyInstaller: 5.7.0 PyQt5: 5.15.2

This is the error message returned by "fbs freeze --debug" (same with "fbs freeze --debug"):

(venv) freyr@Freyrs-iMac-2 venv % fbs run
(venv) freyr@Freyrs-iMac-2 venv % fbs freeze
Could not find any of the following files:
 * Python
 * libpython3.9m.dylib
 * Python3
 * libpython3.9.dylib
 * .Python
mherrmann commented 1 year ago

I'm afraid I cannot reproduce this issue with almost exactly the same versions you have given, nor with PyQt6. How did you install Python? Are you on a Mac M2? What do you get when you type

ls -alh `which python`

?

proftc commented 1 year ago

HI I get the same error on my new Mac M2 fbs run works but freeze also gives

(nmr396) terry@arm64-apple-darwin20 testFBS % fbs freeze Could not find any of the following files:

My Versions fbs 1.0.4 pyinstaller 5.7.0 pyinstaller-hooks-contrib 2022.14 pyparsing 3.0.9 PyQt6 6.4.0 PyQt6-Qt6 6.4.1 PyQt6-sip 13.4.0 python 3.9.6

Thanks for any help

Einmitt commented 1 year ago

Typing which python in the bin folder gives this:

freyr@Freyrs-iMac-2 bin % which python
Python 3.9.1 (default, Jan 22 2021, 11:37:45) [Clang 12.0.0 (clang-1200.0.32.28)] on darwin Type "help", "copyright", "credits" or "license" for more information.

Typing ls -alh gives this:

(venv) freyr@Freyrs-iMac-2 bin % ls -alh total 216 drwxr-xr-x 30 freyr staff 960B Jan 17 14:51 . drwxr-xr-x 23 freyr staff 736B Jan 17 16:59 .. -rw-r--r-- 1 freyr staff 8.6K Dec 8 14:35 Activate.ps1 -rw-r--r-- 1 freyr staff 1.8K Dec 8 14:35 activate -rw-r--r-- 1 freyr staff 841B Dec 8 14:35 activate.csh -rw-r--r-- 1 freyr staff 1.9K Dec 8 14:35 activate.fish -rwxr-xr-x 1 freyr staff 243B Dec 8 14:35 easy_install -rwxr-xr-x 1 freyr staff 243B Dec 8 14:35 easy_install-3.9 -rwxr-xr-x 1 freyr staff 993B Jan 17 16:38 fbs -rwxr-xr-x 1 freyr staff 973B Jan 17 14:48 futurize -rwxr-xr-x 1 freyr staff 231B Jan 17 14:48 macho_dump -rwxr-xr-x 1 freyr staff 231B Jan 17 14:48 macho_find -rwxr-xr-x 1 freyr staff 237B Jan 17 14:48 macho_standalone -rwxr-xr-x 1 freyr staff 977B Jan 17 14:48 pasteurize -rwxr-xr-x 1 freyr staff 234B Dec 8 14:44 pip -rwxr-xr-x 1 freyr staff 234B Dec 8 14:44 pip3 -rwxr-xr-x 1 freyr staff 234B Dec 8 14:44 pip3.10 -rwxr-xr-x 1 freyr staff 234B Dec 8 14:44 pip3.9 -rwxr-xr-x 1 freyr staff 251B Jan 17 14:51 pyi-archive_viewer -rwxr-xr-x 1 freyr staff 246B Jan 17 14:51 pyi-bindepend -rwxr-xr-x 1 freyr staff 249B Jan 17 14:51 pyi-grab_version -rwxr-xr-x 1 freyr staff 245B Jan 17 14:51 pyi-makespec -rwxr-xr-x 1 freyr staff 248B Jan 17 14:51 pyi-set_version -rwxr-xr-x 1 freyr staff 262B Jan 17 14:51 pyinstaller -rwxr-xr-x 1 freyr staff 232B Dec 8 14:44 pylupdate5 -rwxr-xr-x 1 freyr staff 228B Dec 8 14:44 pyrcc5 lrwxr-xr-x 1 freyr staff 7B Dec 8 14:35 python -> python3 lrwxr-xr-x 1 freyr staff 46B Dec 8 14:35 python3 -> /Users/freyr/.pyenv/versions/3.9.1/bin/python3 lrwxr-xr-x 1 freyr staff 7B Dec 8 14:35 python3.9 -> python3 -rwxr-xr-x 1 freyr staff 227B Dec 8 14:44 pyuic5

proftc commented 1 year ago

Hi Michael and news on this - is it a pyinstaller issue on the M2 ? Thanks Terry

mherrmann commented 1 year ago

I don't know. In my opinion, the best place to ask is on the PyInstaller issue tracker.

proftc commented 1 year ago

Hi As a lot of people are buying M2 based Macs the issues with FBS pro are going to cause some problems. I rely on it heavily. Can you look into it? Thanks Terry

Einmitt commented 1 year ago

I should mention, since I raised the issue, that I am not using an M2 but a 4 GHz Quad-Core Intel Core i7. Hence the problem is not limited to M2 machines.

proftc commented 1 year ago

So this is a Ventura or python 3.9 ? issue.? \ Monterey freeze works (Python 3.7 fbs 1.0.0) but installer sometimes fails with an error hdiutil: create failed - Resource busy. Mojave worked without any problems. I just tried using Miniconda with a new installation and now freeze works and the installer works and gives a working app but a new message waited 1 seconds for .DS_STORE to be created. bless: The 'openfolder' is not supported on Apple Silicon devices. Does any else have any experience of all this?

Jeff-Mott-OR commented 3 weeks ago

Hi, all. Before I create a new issue, I thought I'd comment here, because I'm experiencing a similar issue. Using only the "startproject", I can fbs run but I cannot fbs freeze without getting an error that I can reproduce consistently.

Details:

I'm on macOS Big Sur 11.7.10. I'm trying to use the free version of fbs, which means Python 3.6 and PyQt5

I have:

$ eval "$(pyenv init -)"    ; <-- fresh python installed via pyenv

$ python3 --version
3.6.15

$ python3 -m venv venv
$ source venv/bin/activate

(venv) $ pip install --upgrade pip
(venv) $ pip install PyQt5 fbs
(venv) $ fbs startproject    ; <-- default project, no changes
App name [MyApp] : 
MyApp
Author [Bob] : 
Bob
Mac bundle identifier (eg. com.bob.myapp, optional): 

Created the src/ directory. If you have PyQt5 installed, you can now
do:

    fbs run

(venv) $ fbs run    ; <-- ok
(venv) $ fbs freeze
5537 ERROR: Can not find path ./QtPdf.framework/Versions/5/QtPdf (needed by /Users/bob/Documents/Computing/PyQt/venv/lib/python3.6/site-packages/PyQt5/Qt5/plugins/imageformats/libqpdf.dylib)
Done. You can now run `target/MyApp.app/Contents/MacOS/MyApp`. If that
doesn't work, see https://build-system.fman.io/troubleshooting.

(venv) $ ./target/MyApp.app/Contents/MacOS/MyApp    ; <-- bad
Segmentation fault: 11

Any thoughts on a potential culprit? Any investigations I should perform next?

Thanks!

EDIT: I suspect the issue is I need a newer Mac. I guess I'll buy one and update later to confirm.