Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8203921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T07:43:32+00:00 2026-06-07T07:43:32+00:00

tl;dr I accidentally deleted my Python installation’s site.py file. Now, when trying to start

  • 0

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 downloading a site.py from setuptools but this results in an infinite recursion in the __boot method around the statement imp.load_module('site',stream,path,descr) (line 37).

Is there a way to fix this without reinstalling Python? What is the site.py file supposed to do?

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 are set up in such a way as to find my installation first.

As to why I deleted the site.py file: I tried executing a setuptools setup.py script and the script told me to delete the file because it “was not created by setuptools”. I foolishly complied.

I suspect that this original error message was caused by the fact that the setuptools implementation is not mine.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T07:43:35+00:00Added an answer on June 7, 2026 at 7:43 am

    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 python 2.7
    • For python 3.2

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I accidentally deleted hadoop.tmp.dir, in my case /tmp/{user.name}/*. Now everytime when I run hive
I accidentally deleted my sdk 3.0 directory, thinking I didn't need it. Now when
I tried looking for the answer but didn't find it. I accidentally deleted my
I'm trying to recover an app that I accidentally deleted and managed to do
I accidentally deleted my gen folder and now, predictably, my resources are all messed
i accidentally deleted the original plist file that comes with the template for an
I accidentally deleted my firstviewcontroller.m file which is for a view that has a
I have accidentally deleted a Java file from my Eclipse workspace. Can i recover
I accidentally deleted a .m file from Xcode. I didn't have version Control on
I accidentally deleted the Apple submission certificate in the Keychain, now whenever I run

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.