How do I choose which Python installation to run in a PyObjC program?
3 answers
Try giving the full path to the Python interpreter on the command line, for example:
/foo/bar/python2.6 script.py /baz/python objcscript.py
You can also add a shebang to the beginning of your script (first line):
#! /foo/bar/python2.6 script.py
If you have an environment variable PYTHONPATH
, you may need to unset or change it.
+2
a source to share
AFAIR this helped me (in main.m):
NSArray *pythonPathArray = [NSArray arrayWithObjects: resourcePath, [resourcePath stringByAppendingPathComponent:@"PyObjC"], @"/System/Library/Frameworks/Python.framework/Versions/Current/Extras/lib/python/", @"/Library/Python/2.5/site-packages", nil];
Also, make sure it points to the Python installation you want to use (main.m):
Py_SetProgramName("/usr/bin/python");
+2
a source to share