Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.016 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'error:': 0.07; 'importerror:': 0.07; 'problem:': 0.07; 'prefix': 0.09; 'python': 0.11; 'codec': 0.16; 'interpreter,': 0.16; 'path.': 0.16; 'received:fi': 0.16; 'module': 0.19; 'dependent': 0.19; 'load': 0.23; 'error': 0.23; 'skip:" 30': 0.26; 'post': 0.26; 'header:In- Reply-To:1': 0.27; 'libraries': 0.31; 'file': 0.32; 'could': 0.34; 'problem': 0.35; 'thanks': 0.36; 'received:10': 0.37; 'being': 0.38; 'to:addr:python-list': 0.38; 'help,': 0.39; 'to:addr:python.org': 0.39; 'unable': 0.39; 'forum': 0.61; 'full': 0.61; 'header:Message-Id:1': 0.63; 'kind': 0.63; 'charset:windows-1252': 0.65; 'received:130': 0.73 X-Virus-Scanned: amavisd-new at cc.jyu.fi Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: Py_SetProgramName() and prefixes From: Marko Havu In-Reply-To: Date: Thu, 28 Aug 2014 15:42:34 +0300 Content-Transfer-Encoding: quoted-printable References: To: python-list@python.org X-Mailer: Apple Mail (2.1878.6) X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 21 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1409229762 news.xs4all.nl 2931 [2001:888:2000:d::a6]:42021 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:77204 Marko Havu 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 > Could not find platform dependent libraries > Consider setting $PYTHONHOME to [:] > Fatal Python error: Py_Initialize: unable to load the file system = codec > ImportError: No module named =92encodings=92 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