When enable multilib, it fails to run python3: | Could not find platform independent libraries | Could not find platform dependent libraries | Consider setting $PYTHONHOME to [:] | Fatal Python error: Py_Initialize: Unable to get the locale encoding | ImportError: No module named 'encodings' | | Current thread 0x00007f62ea5b2700 (most recent call first): | Aborted (core dumped) The root cause is the module search path /usr/lib is wrong for x86-64 when multilib is enabled. So replace fixed path string with right macro. Upstream-Status: Pending Signed-off-by: Kai Kang --- diff --git a/Modules/getpath.c b/Modules/getpath.c index 18deb60..d22af53 100644 --- a/Modules/getpath.c +++ b/Modules/getpath.c @@ -494,7 +494,7 @@ calculate_path(void) _pythonpath = Py_DecodeLocale(PYTHONPATH, NULL); _prefix = Py_DecodeLocale(PREFIX, NULL); _exec_prefix = Py_DecodeLocale(EXEC_PREFIX, NULL); - lib_python = Py_DecodeLocale("lib/python" VERSION, NULL); + lib_python = Py_DecodeLocale(LIB_PYTHON, NULL); if (!_pythonpath || !_prefix || !_exec_prefix || !lib_python) { Py_FatalError( @@ -683,7 +683,7 @@ calculate_path(void) } else wcsncpy(zip_path, _prefix, MAXPATHLEN); - joinpath(zip_path, L"lib/python00.zip"); + joinpath(zip_path, LIB L"/python00.zip"); bufsz = wcslen(zip_path); /* Replace "00" with version */ zip_path[bufsz - 6] = VERSION[0]; zip_path[bufsz - 5] = VERSION[2]; @@ -695,7 +695,7 @@ calculate_path(void) fprintf(stderr, "Could not find platform dependent libraries \n"); wcsncpy(exec_prefix, _exec_prefix, MAXPATHLEN); - joinpath(exec_prefix, L"lib/lib-dynload"); + joinpath(exec_prefix, LIB L"/lib-dynload"); } /* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */