3

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

Jack Yoon
  • 71
  • 4
  • Possible duplicates : [https://stackoverflow.com/q/69007748/12715723](https://stackoverflow.com/q/69007748/12715723) – Jordy Feb 09 '23 at 08:37
  • As I have already mentioned in the post, I have already looked at the link and the error is slightly different and I have tried the suggestions in the post. :) – Jack Yoon Feb 09 '23 at 08:39

1 Answers1

1

it's not really an answer, not really a comment either (so don't accept this answer as is, it provides nothing but links)

Are you on Windows? have you seen the github issues page for Anaconda? This appers to be someone else with your problem: https://github.com/ContinuumIO/anaconda-issues/issues/11949

HunnyBear
  • 117
  • 1
  • 1
  • 10
  • I found the link after I asked the question but I am not really in the situation to reinstall Windows :S. Thanks anyways – Jack Yoon Feb 15 '23 at 01:06
  • well, that's 100% fair, maybe add the link as context to your post and I can delete this answer XD – HunnyBear Feb 15 '23 at 19:26