miladfa7
(milad farzalizadeh)
September 11, 2021, 6:14am
1
python version is used python3.8 It gives this error when I run python3
python3
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 = 'python3'
isolated = 0
environment = 1
user site = 1
import site = 1
sys._base_executable = '/usr/bin/python3'
sys.base_prefix = '/usr'
sys.base_exec_prefix = '/usr'
sys.executable = '/usr/bin/python3'
sys.prefix = '/usr'
sys.exec_prefix = '/usr'
sys.path = [
'/usr/lib/python38.zip',
'/usr/lib/python3.8',
'/usr/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'
1 Like
tjol
(Thomas Jollans)
September 11, 2021, 7:30am
2
Hi Milad,
for anybody here to be able to help you diagnose this problem, you’re going to have to provide a bit more information:
What operating system are you using? What version (and distribution)? How did you install Python 3.8?
You’ve shown us that the python3
command doesn’t work. Can you start Python or some Python program in any other way that you know of?
1 Like
miladfa7
(milad farzalizadeh)
September 11, 2021, 8:52am
3
operating system = Ubuntu 20.04
already python 3.8 was installed suddenly Python did not work and even some programs do not work like terminal or software update etc.
any Python program doesn’t work
Isn’t this a problem? PAYTHONHOME , PAYTHONPATH is not set.
1 Like
miladfa7
(milad farzalizadeh)
September 11, 2021, 8:54am
4
When I execute this command sudo apt update
, it gives the same error again.
1 Like
tjol
(Thomas Jollans)
September 11, 2021, 9:39am
5
What do you mean, “suddently”? Did you do anything between Python working and Python not working?
Anyway it looks like your Python installation is somehow missing some core components. This is not something that happens just like that, and depending on what caused it it’s possible a lot more of your system is broken.
You may be able to fix this by reinstalling all core Python 3.8 packages. (At the very least libpython3.8-minimal
, which should contain /usr/lib/python3.8/encodings/*
.
2 Likes
miladfa7
(milad farzalizadeh)
September 11, 2021, 9:48am
6
ls /usr/lib/python3.8/encodings
output:
'/usr/lib/python3.8/encodings': No such file or directory
1 Like
miladfa7
(milad farzalizadeh)
September 11, 2021, 10:11am
7
I think most Python3.8 files are deleted right?
1 Like
miladfa7
(milad farzalizadeh)
September 11, 2021, 2:04pm
8
reinstalling all core Python 3.8 packages then SOLVED.
thank you very much
1 Like