When I launch Anaconda Prompt I get the following error message:
Fatal Python error: init_import_site: Failed to import the site module
Python runtime state: initialized
Traceback (most recent call last):
File "C:\Users\USER\anaconda3\lib\site.py", line 589, in <module>
File "C:\Users\USER\anaconda3\lib\site.py", line 576, in main
File "C:\Users\USER\anaconda3\lib\site.py", line 359, in addsitepackages
File "C:\Users\USER\anaconda3\lib\site.py", line 208, in addsitedir
File "C:\Users\USER\anaconda3\lib\site.py", line 164, in addpackage
OSError: [Errno 9] Bad file descriptor
I am aware of very similar post but still I have not managed to solve this issue.
The anaconda had been working fine until a week ago and I haven't coded since then. When I tried to get back to it, anaconda navigator won't open and when I launch Anaconda Prompt (or try to run any code via visual studio code) this happens.
I have not created any file that has weird name recently (which seems to be one of common reasons for this problem) so I am very stuck.
So first thing I tried was trying the answers from above post (and more but they seemed irrelevant/infeasible since I can't access any of the conda-related commands at the moment)
One key problem seems to be having multiple versions of python used in one machine and I am 'almost' free from this issue since I have only used python that comes from conda in this laptop. I have used multiple versions in different environments of conda but this should not be an issue? Especially after I have reinstalled anaconda.
Even after reinstalling anaconda same problems persists. (Tried deleting properly following some of the answers also)
Just to add I am using windows 10 so some of the suggestions that were made in the previous post had not been applicable. My colleagues suggests the problem was caused by windows update but not certain.
Any suggestion would be much appreciated