Py_SetProgramName() and prefixes
Marko Havu
marko.havu at jyu.fi
Thu Aug 28 08:42:34 EDT 2014
Marko Havu <marko.havu at jyu.fi> kirjoitti 28.8.2014 kello 12.58:
> I have a problem with Py_Initialize() not being able to find python in the path. Unless I use Py_SetProgramName() with the full path of the python interpreter, I get the following error message:
> Could not find platform independent libraries <prefix>
> Could not find platform dependent libraries <exec_prefix>
> Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
> Fatal Python error: Py_Initialize: unable to load the file system codec
> ImportError: No module named ’encodings’
Turns out this was an Anaconda-specific problem: Py_SetProgramName() resolves the prefix to "/opt/anaconda1anaconda2anaconda3". I sent a post to Anaconda public support forum (anaconda at continuum.io) to find out whether it can be solved without setting $PYTHONHOME or calling Py_SetProgramName() with a full path.
Thanks for your kind help,
Marko Havu
More information about the Python-list
mailing list