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

Info.plist file must have a PyRuntimeLocations array #532

Open
jwojcik999 opened this issue Aug 14, 2024 · 4 comments
Open

Info.plist file must have a PyRuntimeLocations array #532

jwojcik999 opened this issue Aug 14, 2024 · 4 comments

Comments

@jwojcik999
Copy link

So, this is a new thing for us. Never had a problem with this app before. I love it, and thank you building it! However, just recently I tried to build my app again with only minor changes to my py code. After it builds the app, I get an error when running it and I have to terminate it. My app is basically a GUI using Tkinter. Here is the error message:

The Info.plist file must have a PyRuntimeLocations array containing string values for preferred Python runtime locations. These strings should be "otool -L" style mach ids; "@executable_stub" and "~" prefixes will be translated accordingly.

It this something new with a recent Mac OS update? I'm not a developer, so I would greatly appreciate any guidance you can give me or point me in the right direction. Thank you!

@jwojcik999
Copy link
Author

jwojcik999 commented Aug 14, 2024

I should note that I tried adding this to the setup.py options:
'plist': {'PyRuntimeLocations': ['/Library/Frameworks/Python.framework/Versions/3.12/bin/python3',]}
I found the directory using which python3
Also, I'm not running the -A option for an in-place app.

@jwojcik999
Copy link
Author

I narrowed this down to the pyodbc package. I'm using sqlalchemy to talk to an MSSQL server. For the connection engine, it's using pyodbc. Once I include the pyodbc package, the problem occurs with the PyRuntimeLocations array. I can't use an older pyodbc version with python 3.12, so I can't go lower than version 5.1. When I exclude the pyodbc package, then I get this error when I try to create a connection engine.

Unexpected error occured.
dlopen(/dist/WCCApps.app/Contents/Resources/lib/python3.12/lib-dynload/pyodbc.so, 0x0002): Library not loaded: @loader_path/../../../../opt/libtool/lib/libltdl.7.dylib
Referenced from: <91F8778A-6065-37AC-8768-9FF08039ACC4> /dist/WCCApps.app/Contents/Frameworks/libodbc.2.dylib
Reason: tried: '/dist/WCCApps.app/Contents/Frameworks/../../../../opt/libtool/lib/libltdl.7.dylib' (no such file), '/usr/local/lib/libltdl.7.dylib' (no such file), '/usr/lib/libltdl.7.dylib' (no such file, not in dyld cache)

Any suggestions @ronaldoussoren or anyone? Thank you!

@ronaldoussoren
Copy link
Owner

Py2app currently does not support "@loader_path" for automatically including files. It might work to add the file explicitly by using "python3 setup.py py2app --frameworks=/path/to/libltdl.7.dylib".

@jwojcik999
Copy link
Author

Thank you @ronaldoussoren for the suggestion. I don't know where that dylib file lives to include it. I think it has something to do with libtools, which is already installed on my Mac.

Are you familiar with this original error message when starting my app (which included the pyodbc package)?

The Info.plist file must have a PyRuntimeLocations array containing string values for preferred Python runtime locations. These strings should be "otool -L" style mach ids; "@executable_stub" and "~" prefixes will be translated accordingly.

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

No branches or pull requests

2 participants