Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #77204

Re: Py_SetProgramName() and prefixes

Subject Re: Py_SetProgramName() and prefixes
From Marko Havu <marko.havu@jyu.fi>
Date 2014-08-28 15:42 +0300
References <D361A7BF-0C50-4A59-9083-5F80755F792C@jyu.fi>
Newsgroups comp.lang.python
Message-ID <mailman.13555.1409229762.18130.python-list@python.org> (permalink)

Show all headers | View raw


Marko Havu <marko.havu@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@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

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Py_SetProgramName() and prefixes Marko Havu <marko.havu@jyu.fi> - 2014-08-28 15:42 +0300

csiph-web