Title: Python 3.9.1 building process could not use local standard library
Type: compile error Stage: resolved
Components: macOS Versions: Python 3.9
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: ned.deily, ronaldoussoren, xz_sophos
Priority: normal Keywords:

Created on 2020-12-16 10:47 by xz_sophos, last changed 2022-01-03 07:07 by ned.deily. This issue is now closed.

Messages (2)
msg383144 - (view) Author: (xz_sophos) Date: 2020-12-16 10:47
When trying to build python 3.9.1 on Mac OSX 10.15, one of the building step by make is to run this command: 

DYLD_FRAMEWORK_PATH=/Users/jenkins/BaseFolder/savmac-python ./python.exe -E -S -m sysconfig --generate-posix-vars ;\
 	if test $? -ne 0 ; then \
 		echo "generate-posix-vars failed" ; \
 		rm -f ./pybuilddir.txt ; \
 		exit 1 ; \

It would produce this error message: 

Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Python path configuration:
  PYTHONHOME = (not set)
  PYTHONPATH = (not set)
  program name = '/Library/Frameworks/Python.framework/Versions/3.7/bin/python3'
  isolated = 0
  environment = 0
  user site = 1
  import site = 0
  sys._base_executable = '/Library/Frameworks/Python.framework/Versions/3.7/bin/python3'
  sys.base_prefix = '/Users/jenkins/BaseFolder/savmac-python/sophos/tmp/Python.framework/Versions/3.9'
  sys.base_exec_prefix = '/Users/jenkins/BaseFolder/savmac-python/sophos/tmp/Python.framework/Versions/3.9'
  sys.platlibdir = 'lib'
  sys.executable = '/Library/Frameworks/Python.framework/Versions/3.7/bin/python3'
  sys.prefix = '/Users/jenkins/BaseFolder/savmac-python/sophos/tmp/Python.framework/Versions/3.9'
  sys.exec_prefix = '/Users/jenkins/BaseFolder/savmac-python/sophos/tmp/Python.framework/Versions/3.9'
  sys.path = [
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

Current thread 0x000000011668ddc0 (most recent call first):
<no Python frame>
15:08:54 stdout: generate-posix-vars failed
make: *** [pybuilddir.txt] Error 1

Please note that current working directory is : /Users/jenkins/BaseFolder/savmac-python

In the Mac, there is already a python 3.7 installed at: /Library/Frameworks/Python.framework/Versions/3.7/bin/python3

I wonder what's the root cause of the above ./python.exe error, as I don't have this error on a different MacOS 10.15 with an existing installation of "python" (version 3.9.1)
msg409565 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2022-01-03 07:07
Thanks for the report. Alas, there haven't been any other reports of similar behavior that I am aware of and, without more information, I am unable to reproduce it with the current 3.9 branch. So I am going to close this issue. Feel free to re-open it and provide more detail on exactly how to reproduce the failure if this is still a problem.
Date User Action Args
2022-01-03 07:07:25ned.deilysetstatus: open -> closed
resolution: out of date
messages: + msg409565

stage: resolved
2020-12-16 10:47:58xz_sophoscreate