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

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
qwerty_ww's avatar
234
qwerty_ww
asked 4 years ago
Wingware Support's avatar
4.2k
Wingware Support
updated 4 years ago

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 (4 years ago)
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...

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Wingware Support's avatar
4.2k
Wingware Support
answered 4 years ago
link

Comments

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

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)