Python Forum
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesyste
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesyste
#1
- If I export PYTHONHOME=/usr/bin, I got the following ERRORs.


Quote:➜ build git:(master) ✗ echo $PYTHONHOME
/usr/bin
➜ build git:(master) ✗ echo $PYTHONPATH
/home/longervision/.local/lib/python3.8/site-packages:/usr/lib/python3.8/site-packages:/usr/local/lib/python3.8/site-packages
➜ build git:(master) ✗ pip show setuptools
Python path configuration:
PYTHONHOME = '/usr/bin'
PYTHONPATH = '/home/longervision/.local/lib/python3.8/site-packages:/usr/lib/python3.8/site-packages:/usr/local/lib/python3.8/site-packages'
program name = '/usr/bin/python'
isolated = 0
environment = 1
user site = 1
import site = 1
sys._base_executable = '/usr/bin/python'
sys.base_prefix = '/usr/bin'
sys.base_exec_prefix = '/usr/bin'
sys.executable = '/usr/bin/python'
sys.prefix = '/usr/bin'
sys.exec_prefix = '/usr/bin'
sys.path = [
'/home/longervision/.local/lib/python3.8/site-packages',
'/usr/lib/python3.8/site-packages',
'/usr/local/lib/python3.8/site-packages',
'/usr/bin/lib/python38.zip',
'/usr/bin/lib/python3.8',
'/usr/bin/lib/python3.8/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 0x00007f12b17cbd80 (most recent call first):
<no Python frame>


- If I export PYTHONHOME=""


Quote:➜ build git:(master) ✗ export PYTHONHOME=""
➜ build git:(master) ✗ pip show setuptools
Name: setuptools
Version: 45.2.0
Summary: Easily download, build, install, upgrade, and uninstall Python packages
Home-page: https://github.com/pypa/setuptools
Author: Python Packaging Authority
Author-email: distutils-sig@python.org
License: UNKNOWN
Location: /home/longervision/.local/lib/python3.8/site-packages
Requires:
Required-by: zope.interface, wadllib, twine, tensorboard, Sphinx, protobuf, Markdown, lazr.restfulclient, launchpadlib, kiwisolver, jsonschema, ipython, google-auth
➜ build git:(master) ✗


Should I export PYTHONHOME=/usr/bin ?

Cheers
Pei
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Failed attempts to load Microsoft Appstore Python DLLs piyushd 0 394 Oct-31-2023, 10:43 AM
Last Post: piyushd
  [ERROR] ParamValidationError: Parameter validation failed: Invalid type for parameter gdbengo 3 10,662 Dec-26-2022, 08:48 AM
Last Post: ibreeden
  [SOLVED] [Debian] UnicodeEncodeError: 'ascii' codec Winfried 1 988 Nov-16-2022, 11:41 AM
Last Post: Winfried
  Upload image to Instagram using python/selenium using image URL failed, need help greenpine 5 5,341 Feb-22-2022, 09:42 PM
Last Post: snippsat
  mysql.connector.errors.ProgrammingError: Failed processing format-parameters; Python ilknurg 3 5,467 Jan-18-2022, 06:25 PM
Last Post: ilknurg
  Handling Python Fatal Error richajain1785 7 5,764 Oct-14-2021, 01:34 PM
Last Post: Tails86
  ASCII-Codec in Python3 [SOLVED] AlphaInc 4 5,991 Jul-07-2021, 07:05 PM
Last Post: AlphaInc
  UnicodeDecodeError: 'utf-8' codec can't decode byte 0x92 error from Mysql call AkaAndrew123 1 3,387 Apr-28-2021, 08:16 AM
Last Post: AkaAndrew123
  Fatal error after trying to play sound. giladal 0 1,897 Oct-22-2020, 10:27 AM
Last Post: giladal
  codec for byte transparency Skaperen 7 3,769 Sep-25-2020, 02:20 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020