site py deleted

0 votes
I have deleted the Python installation file, i.e, the site.py file by mistake. Now after starting Python, it shows the following error:

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)

Can anyone help me with reinstalling Python and also tell me what is the work of site.py file?
Nov 29, 2018 in Python by ana1504.k
• 7,910 points
893 views

1 answer to this question.

0 votes
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.
answered Nov 29, 2018 by SDeb
• 13,300 points

Related Questions In Python

0 votes
1 answer

init.py file

It is used to denote directories on ...READ MORE

answered Jul 20, 2018 in Python by Nietzsche's daemon
• 4,260 points
544 views
0 votes
1 answer

How do I know what's going to be deleted?

An easy system would be to add ...READ MORE

answered Aug 28, 2018 in Python by anonymous
834 views
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,434 views
0 votes
1 answer
0 votes
11 answers
0 votes
1 answer

py.test logging for tests that pass

you could use py-cov combine with pytest py.test ...READ MORE

answered Apr 2, 2019 in Python by SDeb
• 13,300 points
3,725 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP