When I try to run a python command I get a warning about missing module 'encodings'. So I set the PYTHONHOME variable as described in other SO answers, but it still can't find 'encodings'
[root@fedora ~]# python help
Python path configuration:
PYTHONHOME = '/usr/lib64/python3.9/venv/bin/python'
PYTHONPATH = (not set)
program name = 'python'
isolated = 0
environment = 1
user site = 1
import site = 1
sys._base_executable = '/bin/python'
sys.base_prefix = '/usr/lib64/python3.9/venv/bin/python'
sys.base_exec_prefix = '/usr/lib64/python3.9/venv/bin/python'
sys.platlibdir = 'lib64'
sys.executable = '/bin/python'
sys.prefix = '/usr/lib64/python3.9/venv/bin/python'
sys.exec_prefix = '/usr/lib64/python3.9/venv/bin/python'
sys.path = [
'/usr/lib64/python3.9/venv/bin/python/lib64/python39.zip',
'/usr/lib64/python3.9/venv/bin/python/lib64/python3.9',
'/usr/lib64/python3.9/venv/bin/python/lib64/python3.9/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 0x00007f241f6dd740 (most recent call first):
<no Python frame>
[root@fedora ~]#
In case it matters, I recently installed a cross-compilation environment (for Raspberry Pi) on this x86_64 Fedora 34 host. But I don't think that should matter. I tried to reinstall python with dnf reinstall python
but now Python doesn't run, neither do dnf and other utilities.