0

I'm quite new to programming. For the last couple of months I was working with PyCharm without any issues and also didn't do any changes (not sure if I have by accident deleted anything in Pycharm in the external libraries which may be causing any issues?). When running python.exe via CMD I get below error. Same appears in PyCharm, only that the PYTHONPATH differs

PYTHONHOME = (not set)
  PYTHONPATH = (not set)
  program name = 'python.exe'
  isolated = 0
  environment = 1
  user site = 1
  import site = 1
  sys._base_executable = 'C:\\Users\\LXVFL\\AppData\\Local\\Programs\\Python\\Python310\\python.exe'
  sys.base_prefix = ''
  sys.base_exec_prefix = ''
  sys.platlibdir = 'lib'
  sys.executable = 'C:\\Users\\LXVFL\\AppData\\Local\\Programs\\Python\\Python310\\python.exe'
  sys.prefix = ''
  sys.exec_prefix = ''
  sys.path = [
    'C:\\Users\\LXVFL\\AppData\\Local\\Programs\\Python\\Python310\\python310.zip',
    'C:\\Users\\LXVFL\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\',
    'C:\\Users\\LXVFL\\AppData\\Local\\Programs\\Python\\Python310\\DLLs\\',
    'C:\\Users\\LXVFL\\AppData\\Local\\Programs\\Python\\Python310',
  ]
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 0x00002e60 (most recent call first):
  <no Python frame>

What can I do here? Thanks for any kind of help :-)

Nadine
  • 11
  • 1
  • 2
  • Does this answer your question? [Fatal Python error: init\_fs\_encoding: failed to get the Python codec of the filesystem encoding, when trying to start uwsgi](https://stackoverflow.com/questions/65184937/fatal-python-error-init-fs-encoding-failed-to-get-the-python-codec-of-the-file) – alex Mar 28 '22 at 12:45
  • Actually not really, the PYTHONPATH is unset and still the error appears....furthermore, when I want to add a Python interpreter to my PyCharm Project (existing environment), I get this error: "Invalid Python SDK" and I'm not able to set up a new virtual environment in Pycharm. It's very hard to find the root cause of all those errors.. – Nadine Mar 28 '22 at 16:10

2 Answers2

1

Update: What finally solved my problem was to simply deinstall and reinstall Python. Still no clue what even caused the issue in the first place but it is gone

Nadine
  • 11
  • 1
  • 2
0

I encountered the same problem. Reinstalling python solved mine

DALANDA
  • 3
  • 3
  • This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/32301457) – Simas Joneliunas Jul 25 '22 at 01:20