Ask Your Question
1

Mac App refer to Python executable

asked 2021-02-20 12:49:22 -0500

qwerty_ww gravatar image

updated 2021-02-21 08:52:13 -0500

I wanted to refer to a Python shipped with an app: /Applications/FreeCAD.app/Contents/lib/Python

But Wingware won't let me

Some values are invalid:

  • Could not launch or inspect Python executable '/Applications/FreeCAD.app/Contents/lib/Python'. It should be the name of a Python interpreter that is on your PATH (such as python, python3.4, python.exe), a full path to the Python interpreter you wish to use, or a command line that invokes Python with any appended arguments.

Please correct the values and try again.

I'd rather guess this is some silly Mac security feature. However, how do I get rid of it and refer to the app's executable (without having to copy it to some local directory)?

edit retag flag offensive close merge delete

Comments

Hmm. I tried to run this from command iine and there it croaks that it's not a valid executable. Strange, but likely no Wingware issue. The bug in front of the keyboard needs to think....

qwerty_ww gravatar image qwerty_ww  ( 2021-02-20 13:22:38 -0500 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2021-02-21 08:51:50 -0500

It's possible that the app loads Python dynamically. If you are able to get a Python shell in the app, try this:

import sys
print(sys.executable)

Using that executable might work, but there's no real guarantee that there is a regular Python installation in there.

If not, you may still be able to debug Python code running in the app as described here:

https://wingware.com/doc/debug/debugg...

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2021-02-20 12:49:22 -0500

Seen: 80 times

Last updated: Feb 21