Fatal Python error: Py_Initialize: Unable to get the locale encoding ModuleNotFoundError
system:centos 7
python default version
[root@localhost ~]# python
Python 2.7.5 (default, Jun 20 2019, 20:27:34)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
When i execute
docker run -d -it --name phusion phusion/baseimage:0.11
docker logs phusion display:
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ModuleNotFoundError: No module named 'encodings'
then i install python 3 and config env
[root@localhost ~]# python
Python 3.6.8 (default, May 2 2019, 20:40:44)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux
Type "help", "copyright", "credits" or "license" for more information.
but docker don't use python 3, the same error display
Are you getting a python error when you run baseimage, or when you run python through baseimage? Please clarify, thanks and sorry for the delay in answering your report.
Are you getting a python error when you run baseimage, or when you run python through baseimage? Please clarify, thanks and sorry for the delay in answering your report.
Yes, my docker build script require use python.
I got the same problem, but not the same image which is harbor prepare.I found that the container runs ok in centos 7.8 & 7.7 env, and failure in centos 7.9.😂
Which version of the baseimage is being used here? Has this been tested with the focal images?
This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.
Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary.