First time here? Check out the FAQ!
1

Mac App refer to Python executable

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)?

qwerty_ww's avatar
234
qwerty_ww
asked 2021-02-20 12:49:22 -0600
Wingware Support's avatar
4.2k
Wingware Support
updated 2021-02-21 08:52:13 -0600
edit flag offensive 0 remove flag 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's avatar qwerty_ww (2021-02-20 13:22:38 -0600) edit
add a comment see more comments

1 Answer

0

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...

Wingware Support's avatar
4.2k
Wingware Support
answered 2021-02-21 08:51:50 -0600
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer