5

I installed OSX Mavericks to make sure that the application I'm developing can run on this system. I compile with PyInstaller (my build script that uses PYInstaller runs without errors).

The problem is that when I double-click on the executable, I get this error:

Last login: Wed Jan 16 22:56:18 on ttys004
Mac-Pro-de-angelo:~ angelo$ /Users/angelo/miniconda3/envs/apsc/apsc_1_0_0_onefile_mac_osx/apsc ; exit;
objc[5125]: Class RunLoopModeTracker is implemented in both /var/folders/t0/s6_p_gn15798z_8m8w5f6vjm0000gn/T/_MEIWgQ7yV/libQt5Core.5.dylib and /Users/angelo/miniconda3/envs/apsc/lib/libQt5Core.5.6.2.dylib. One of the two will be used. Which one is undefined.
objc[5125]: Class NotificationReceiver is implemented in both /var/folders/t0/s6_p_gn15798z_8m8w5f6vjm0000gn/T/_MEIWgQ7yV/libQt5Widgets.5.dylib and /Users/angelo/miniconda3/envs/apsc/lib/libQt5Widgets.5.6.2.dylib. One of the two will be used. Which one is undefined.
objc[5125]: Class QCocoaPageLayoutDelegate is implemented in both /var/folders/t0/s6_p_gn15798z_8m8w5f6vjm0000gn/T/_MEIWgQ7yV/libQt5PrintSupport.5.dylib and /Users/angelo/miniconda3/envs/apsc/lib/libQt5PrintSupport.5.6.2.dylib. One of the two will be used. Which one is undefined.
objc[5125]: Class QCocoaPrintPanelDelegate is implemented in both /var/folders/t0/s6_p_gn15798z_8m8w5f6vjm0000gn/T/_MEIWgQ7yV/libQt5PrintSupport.5.dylib and /Users/angelo/miniconda3/envs/apsc/lib/libQt5PrintSupport.5.6.2.dylib. One of the two will be used. Which one is undefined.
QObject::moveToThread: Current thread (0x7f9362f5b620) is not the object's thread (0x7f93640b2370).
Cannot move to target thread (0x7f9362f5b620)

You might be loading two sets of Qt binaries into the same process. Check that all plugins are compiled against the right Qt binaries. Export DYLD_PRINT_LIBRARIES=1 and check that only one set of binaries are being loaded.
This application failed to start because it could not find or load the Qt platform plugin "cocoa"
in "".

Available platform plugins are: cocoa, minimal, offscreen.

Reinstalling the application may fix this problem.
Abort trap: 6
logout

[Opération terminée]

If I refer to this post:

pyinstaller + pyqt5: could not find or load "cocoa"

I encounter the same problem but the proposed solution does not work not at my house.

That's how my PYInstaller script is run:

/Users/angelo/miniconda3/envs/apsc/bin/pyinstaller --clean --windowed --onefile --runtime-tmpdir /var/folders/t0/s6_p_gn15798z_8m8w5f6vjm0000gn/T --icon=logo_apsc_256x256.icns --distpath apsc_1_0_0_onefile_mac_osx --name apsc apsc_gui.py

For accuracy my software works fine under MacOSX when launched directly from Python.

Can you help me find a solution?

These are my specifications:

MacOSX 10.9.5 Python 3.4.5, qt-5.6.2, sip-4.18 and pyqt-5.6.0 under Miniconda3-3.8.3

... After ...

I would really like to solve this problem, it's been several days ... and I can not do it.

It has evolved a little but I still have errors and it is still impossible for me to launch my software (the, generated app) under MacOSX after compilation with PyInstaller,

That's what I did:

A symbolic link between libpython3.6m.dylib and libpython3.6.dylib (the latter did not exist in the bin directory of the environment created in miniconda3):

ln -s /Users/angelo/miniconda3/envs/test/lib/libpython3.6m.dylib /Users/angelo/miniconda3/envs/test/lib/libpython3.6.dylib

Then I placed the order:

export DYLD_PRINT_RPATHS=1

It should be noted that I find myself with the error:

21966 ERROR: Can not find path ./libtbb.dylib (needed by /Users/angelo/miniconda3/envs/test/lib/libmkl_tbb_thread.dylib)

The result is a little better but I always find myself with the errors:

    objc[2619]: Class RunLoopModeTracker is implemented in both /private/var/folders/t0/s6_p_gn15798z_8m8w5f6vjm0000gn/T/_MEIqjVaY5/libQt5Core.5.dylib and /Users/angelo/miniconda3/envs/test/lib/libQt5Core.5.6.2.dylib. One of the two will be used. Which one is undefined.
objc[2619]: Class NotificationReceiver is implemented in both /private/var/folders/t0/s6_p_gn15798z_8m8w5f6vjm0000gn/T/_MEIqjVaY5/libQt5Widgets.5.dylib and /Users/angelo/miniconda3/envs/test/lib/libQt5Widgets.5.6.2.dylib. One of the two will be used. Which one is undefined.
QObject::moveToThread: Current thread (0x7ff483848540) is not the object's thread (0x7ff48385ab60).
Cannot move to target thread (0x7ff483848540)

... which I can not get rid of.

If anyone could help me, I'd be really happy,

Help me please.

ekdmekdm
  • 171
  • 1
  • 9
  • 1
    Had the same problem, did you solve it yet? – Dirk Paul May 06 '20 at 03:58
  • I posted my solution here: https://stackoverflow.com/a/72863910/3844056 . I will posit that`libQt5Core` brought by PyInstaller from `miniconda3` is the cause of the conflict. I was able to work around this by NOT using `anaconda` with PyInstaller to package my Qt app. – ruoho ruotsi Jul 05 '22 at 04:26

0 Answers0