Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MacOS 11.5.2 crash on startup #756

Closed
jjfPCSI1 opened this issue Sep 4, 2021 · 25 comments · Fixed by #788
Closed

MacOS 11.5.2 crash on startup #756

jjfPCSI1 opened this issue Sep 4, 2021 · 25 comments · Fixed by #788

Comments

@jjfPCSI1
Copy link

jjfPCSI1 commented Sep 4, 2021

When installing the last MacOS pyzo version from the website (4.11.2), it seems to crash on startup with the given error message.

unnamed

As you seem to have solve the last MacOS update problem in #731, is this somehow related or is it a new problem ?

@almarklein
Copy link
Member

Hi, thank for the report! Were you using Pyzo before, and is there something that changed after which you got this error? E.g. upgraded either Pyzo or your Mac?

@jjfPCSI1
Copy link
Author

jjfPCSI1 commented Sep 6, 2021

It's on a fresh computer that has not seen Pyzo before this installation.

@almarklein
Copy link
Member

This looks like this description of a bug recently fixed in pyinstaller: "(macOS) Fix python shared library detection for non-framework python builds when the library path cannot be inferred from imports of the python executable. (#6021)"

@almarklein
Copy link
Member

I just ran a new build with the latest PyInstaller. With some luck this fixes it. Could you please try? https://github.com/pyzo/pyzo/releases/download/v4.11.2/pyzo-4.11.2-maybefix1-macos.dmg

@jjfPCSI1
Copy link
Author

jjfPCSI1 commented Sep 8, 2021

There is an error saying that Pyzo is damaged and therefore could not be open.

damaged_pyzo

@almarklein
Copy link
Member

LOL, I cannot open the image you linked: it cannot be displayed because it contains errors. What curse is this? :P

I uploaded another artifact. Try this one: https://github.com/pyzo/pyzo/releases/download/v4.11.2/pyzo-4.11.2-maybefix2-macos.dmg

@jjfPCSI1
Copy link
Author

jjfPCSI1 commented Sep 8, 2021

Strange curse indeed because I can see it.
But it's just an image of the error message that says (in French so I have to translate): Pyzo is damaged and can't be open. You should put this item in the trash (and you're given the choice: put in trash or cancel).

No luck with the new one. Even worse: on an older MacOS (10.15.7), it's not working anymore with the same error message.

PyzoDamagedError

@SzamCha
Copy link

SzamCha commented Sep 8, 2021 via email

@jjfPCSI1
Copy link
Author

jjfPCSI1 commented Sep 8, 2021

Hi ! Same issue with this download on MacOS 12 beta. Can you check the size of the downloaded dmg ? 86,5 MB or 86 484 551 bytes for me.

Only 32M for me, but coherent with previous downloads

 ~/Downloads>du -h pyzo*dmg
 34M	pyzo-4.11.2-macos.dmg
 32M	pyzo-4.11.2-maybefix2-macos.dmg

@SzamCha
Copy link

SzamCha commented Sep 8, 2021 via email

@jjfPCSI1
Copy link
Author

jjfPCSI1 commented Sep 8, 2021

I meant the Pyzo size. Not the dmg.

There it is:

/Applications>\du -ks pyzo*
85552	pyzo.app
92700	pyzo_working.app

pyzo_working.app being my safety net of the previous working copy.

@almarklein
Copy link
Member

So, if I understand correctly, the DMG opens, and when you extract Pyzo that all works, but on starting Pyzo it produces the error?

@jjfPCSI1
Copy link
Author

That's right.

@almarklein
Copy link
Member

almarklein commented Sep 13, 2021

Another attempt, using PySide2: https://github.com/pyzo/pyzo/releases/download/v4.11.2/pyzo-4.11.2-maybefix3-macos.dmg

I'm not even sure whether this is an issue with the freezing process itself of related to Qt ...

@jjfPCSI1
Copy link
Author

Still the same error either on MacOS 11.5.2 or 10.15.7. Sorry.

@adddvent
Copy link
Contributor

My guess is that there is an outdated python3.7.0 somewhere on the computer that crashes and this also takes down pyzo.

On the first run, when there was no pyzo on the computer before, pyzo will search for all python binaries in specific places and it will run all of these binaries in a subprocess with the "-V" argument to obtain the python version string, so pyzo can suggest the user to use the binary with the highest version.
see https://github.com/pyzo/pyzo/blob/master/pyzo/util/interpreters/pythoninterpreter.py#L103
see https://github.com/pyzo/pyzo/blob/master/pyzo/util/interpreters/__init__.py

On a Linux system, invalid or missing libraries will just cause the subprocess to terminate, but I guess, that macOS 11 will also take down the parent process (pyzo).

@jjfPCSI1:
Can you check what happens when you run that python 3.7.0 manually in a bash terminal? I guess, it will crash with the same error message.
Please also try to use a dummy config file so that pyzo will not search for and execute all python binaries:
create a textfile "~/Library/Application Support/pyzo/config.ssdf" with the following contents and start pyzo afterwards:

shellConfigs2 = list:
  dict:
    name = 'Python'
    exe = '/usr/bin/python3'
    gui = 'auto'

@almarklein
Copy link
Member

I revamped the whole freezing process. Could the people who are watching this please try the binary here? https://github.com/almarklein/pyzo/releases/tag/vt201 Please let me know whether it works for you!

@jjfPCSI1
Copy link
Author

Unfortunately not. I tried this version against MacOS 10.15.7 (Catalina) and still got the same "Pyzo is damaged" error as in #756 (comment)

@jjfPCSI1
Copy link
Author

@adddvent
I've just seen your past comment. But no, there are no outdated Python3.7 on my system. I've got

/usr/bin/python    # 2.7.16
/usr/bin/python3   # 3.8.2
/opt/bin/python    # 3.9.9
/opt/bin/python3.6 # 3.6.15
/opt/bin/python3.7 # 3.7.12
/opt/bin/python3.8 # 3.8.12
/opt/bin/python3.9 # 3.9.9

all of them are working versions that I use from time to time directly from the command line.

I also tried your config.ssdf file but it does not change anything.

One thing though for @almarklein , when I copy pyzo from the .dmg and start it for the first time, it takes several seconds before answering the "Pyzo is damaged" error, whereas when I start it a second (or third) time, it gives the error right away.

@almarklein
Copy link
Member

Thanks for testing. I just read this page explaining that it might just be something regarding the signing: https://qiagen.secure.force.com/KnowledgeBase/KnowledgeNavigatorPage?id=kA41i000000L5swCAC

I wonder if its because we add files to the pyzo.app after it has been created (and signed) by pyinstaller ...

@almarklein almarklein pinned this issue Dec 21, 2021
@almarklein
Copy link
Member

almarklein commented Dec 21, 2021

I tried preventing editing the .app after it has been created. Could you try this please: https://github.com/pyzo/pyzo/releases/download/v4.11.7/pyzo-4.11.7-macos_x86_64_02.dmg If it works, please also try it a second time, I'm not sure what happens to any .pyd files that may have been created in the first run.

start it for the first time, it takes several seconds

Yeah, the very first time is known to take longer. I suppose its due to the compilation of py files, though there are not that many so it's actually surprising that the difference is so large not that I think about it. Could also be that file system caching plays a role.

@jjfPCSI1
Copy link
Author

Ok then:

@almarklein
Copy link
Member

I have a Mac M1 now, and I can reproduce the original error.

The latest binaries that I linked do work for me, except that I get a warning "Pyzo can’t be opened because Apple cannot check it for malicious software." I then had to control-click it, click open, and tell it to open anyway. I'm a Mac newby, is this normal for downloaded apps, or is there something we can do to make that warning go away (e.g. signing the binary with our own signature?)

In the mean time I will probably make a new release tomorrow.

@almarklein almarklein unpinned this issue Jan 20, 2022
@almarklein
Copy link
Member

Looks like pyinstaller/pyinstaller#5434 and may have been fixed in pyinstaller by pyinstaller/pyinstaller#5451

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants