TL; DR
I accidentally deleted the site.py Python site.py . Now, trying to run Python, he complains
ImportError: could not find the real site module
I tried loading site.py from setuptools , but this leads to infinite recursion in the __boot method around the imp.load_module('site',stream,path,descr) (line 37).
Is there a way to fix this without reinstalling Python? What should the site.py file site.py ?
Some background information:
This is on a Linux server with a custom Python installation in my home directory ( ~/nfs , to be precise). There are other Python installations on the server (not mine â it's a mess!), But $PATH and $PYTHONPATH set up to find my installation first.
Why I deleted the site.py file: I tried to execute setuptools setup.py script, and the script told me to delete the file because it "was not created by setuptools". I acted stupidly.
I suspect that this original error message was caused by the fact that the setuptools implementation is not mine.
source share