This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Joshua.Cogliati
Recipients Joshua.Cogliati
Date 2012-06-06.22:37:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1339022249.32.0.319991311655.issue15020@psf.upfronthosting.co.za>
In-reply-to
Content
In Python/pythonrun.c the following definition exists:
static wchar_t *progname = L"python";

This is then used by Py_GetProgramName which is used by calculate_path in Modules/getpath.c 

Since in python 3, the default executable is python3, and not python, when calculate_path searches for "python" it will find where python 2 is installed instead of where python3 is installed.  This is the error message that this causes:

Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]

I recommend that line be changed to:
static wchar_t *progname = L"python3";

since that is the default executable name.

For my purposes (which is making an executable that embedds python 3), I was able to work around this by calling: 
Py_SetProgramName(L"python3");
before
Py_Initialize();
History
Date User Action Args
2012-06-06 22:37:29Joshua.Cogliatisetrecipients: + Joshua.Cogliati
2012-06-06 22:37:29Joshua.Cogliatisetmessageid: <1339022249.32.0.319991311655.issue15020@psf.upfronthosting.co.za>
2012-06-06 22:37:28Joshua.Cogliatilinkissue15020 messages
2012-06-06 22:37:28Joshua.Cogliaticreate