-1

I recently tried adding an Xlwings add-in to my ms excel and in doing so, moved around and deleted a bunch of files in my computer. Now I can't run Conda and I get the error message below on my terminal when I try to run any kind of Conda command.

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 = '/opt/anaconda3/bin/python'

  isolated = 0

  environment = 1

  user site = 1

  import site = 1

  sys._base_executable = '/opt/anaconda3/bin/python'

  sys.base_prefix = '/opt/anaconda3'

  sys.base_exec_prefix = '/opt/anaconda3'

  sys.platlibdir = 'lib'

  sys.executable = '/opt/anaconda3/bin/python'

  sys.prefix = '/opt/anaconda3'

  sys.exec_prefix = '/opt/anaconda3'

  sys.path = [

    '/opt/anaconda3/lib/python39.zip',

    '/opt/anaconda3/lib/python3.9',

    '/opt/anaconda3/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'

I saw the other post ImportError: No module named 'encodings' about this issue and tried following the instructions there but it didn't help in my case. Can someone please help with this? I've been trying to unsuccessfully solve this issue for days now and I'm all out of ideas.

3 Answers3

0

If you previously created environments like below and set to PYTHONHOME C:\ProgramData\Anaconda3\envs\py39 Adjust it back to: C:\ProgramData\Anaconda3
This is because a new install you dont have "envs" yet. Not until you: conda create --name py39 python=3.9 conda activate py39

user3761555
  • 851
  • 10
  • 21
-1

Solved. The solution was to install anaconda3 using command line installer rather than graphical installer.

-1

I had the problem with anaconda under Windows when I have an embedded python in my c++ app via Python C-API.

I had the following error, where they key was, that

c:\ProgramData\Anaconda3\python39.zip

did not exist. I created a text file of that name and that solved for me the problem.

Python path configuration:
  PYTHONHOME = (not set)
  PYTHONPATH = (not set)
  program name = 'python'
  isolated = 0
  environment = 1
  user site = 1
  import site = 1
  [...]
  sys.prefix = 'c:\\ProgramData\\Anaconda3'
  sys.exec_prefix = 'c:\\ProgramData\\Anaconda3'
  sys.path = [
    'c:\\ProgramData\\Anaconda3\\python39.zip',
    '.\\DLLs',
    '.\\lib',
    [...],
  ]
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'
Fabian
  • 107
  • 1
  • 5