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
• 6,110 points
40 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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
• 9,660 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
19 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 27, 2018 in Python by anonymous
21 views
0 votes
1 answer

how can i count the items in a list?

suppose you have a list a = [0,1,2,3,4,5,6,7,8,9,10] now ...READ MORE

answered May 2 in Python by Mohammad
• 1,400 points
23 views
0 votes
10 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 in Python by SDeb
• 9,660 points
14 views
+1 vote
1 answer

Where to set hadoop.tmp.dir? core-site.xml or hdfs-site.xml?

hadoop.tmp.dir (A base for other temporary directories) is ...READ MORE

answered Mar 26, 2018 in Big Data Hadoop by nitinrawat895
• 9,070 points
1,280 views
+2 votes
2 answers

Can I run 'manage.py' from AWS EB Linux instance

You can refer to this documentation :- https://docs.aws.amazon.com/el ...READ MORE

answered Aug 17, 2018 in Cloud Computing by Priyaj
• 56,120 points
112 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.