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.

classification
Title: Unable to compile 3.0b3 on Ubuntu systems: Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Type: Stage:
Components: Build Versions: Python 3.9
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: ajung, lukasz.langa, vstinner, zach.ware
Priority: normal Keywords:

Created on 2020-08-12 08:23 by ajung, last changed 2022-04-11 14:59 by admin.

Messages (3)
msg375216 - (view) Author: Andreas Jung (ajung) Date: 2020-08-12 08:23
Building 3.9.0b3 fails on Ubuntu 19 and 20 in same way:

./python -E -S -m sysconfig --generate-posix-vars ;\
if test $? -ne 0 ; then \
        echo "generate-posix-vars failed" ; \
        rm -f ./pybuilddir.txt ; \
        exit 1 ; \
fi
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 = './python'
  isolated = 0
  environment = 0
  user site = 1
  import site = 0
  sys._base_executable = '/home/ajung/src/pp.server/Python-3.9.0b3/python'
  sys.base_prefix = '/opt/python-3.9.0b3'
  sys.base_exec_prefix = '/opt/python-3.9.0b3'
  sys.platlibdir = 'lib'
  sys.executable = '/home/ajung/src/pp.server/Python-3.9.0b3/python'
  sys.prefix = '/opt/python-3.9.0b3'
  sys.exec_prefix = '/opt/python-3.9.0b3'
  sys.path = [
    '/opt/python-3.9.0b3/lib/python39.zip',
    '/opt/python-3.9.0b3/lib/python3.9',
    '/opt/python-3.9.0b3/lib/lib-dynload',
  ]
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 0x00007f824c25c280 (most recent call first):
<no Python frame>
generate-posix-vars failed
make: *** [Makefile:612: pybuilddir.txt] Error 1
msg375282 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2020-08-12 20:10
Can you reproduce this with the current release (3.9.0rc1)?  Also, how did you call `./configure` and `make`?

Adding Łukasz so this is on his radar in case the first answer is affirmative and there's nothing exotic in the second.  For the record, I can't reproduce on Ubuntu-based Pop_OS 20.04.
msg375284 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-08-12 20:23
It seems like you're getting the error while running "make". I'm surprised by the sys.path value. Do you have a file called pybuilddir.txt in the current directory? If yes, what does it contain?

Can you please try the command:

make SHELL="bash -x"

What is your current directory? Is it '/home/ajung/src/pp.server/Python-3.9.0b?
History
Date User Action Args
2022-04-11 14:59:34adminsetgithub: 85701
2020-08-12 20:23:46vstinnersetnosy: + vstinner
messages: + msg375284
2020-08-12 20:10:45zach.waresetnosy: + lukasz.langa, zach.ware
messages: + msg375282
2020-08-12 08:23:18ajungcreate