Skip to content Skip to sidebar Skip to footer

Python Fails After Deleting Site.py

tl;dr I accidentally deleted my Python installation’s site.py file. Now, when trying to start Python, it complains, ImportError: Couldn't find the real 'site' module I tried do

Solution 1:

The site module sets up your python module search path and some other things. It is somewhat crucial to the normal operation of python.

You can download a new copy from the python source repository:

For other python versions, generally the URL is http://hg.python.org/cpython/file/*major*.*minor*/Lib/site.py for the correct tagged version, then select the raw link in the left-hand menu.

If you installed python from a linux distribution package on Ubuntu or Debian, then this file has been customized and you'll need to re-install the appropriate python-minimal package.


Post a Comment for "Python Fails After Deleting Site.py"