Runtime error

S

Sebastian

Hi all,

I am new to python and I don't know how to fix this error. I only try to
execute python (or a cgi script) and I get an ouptu like

[...]
'import site' failed; traceback:
Traceback (most recent call last):
File "/usr/lib/python2.6/site.py", line 513, in <module>
main()
File "/usr/lib/python2.6/site.py", line 496, in main
known_paths = addsitepackages(known_paths)
File "/usr/lib/python2.6/site.py", line 288, in addsitepackages
addsitedir(sitedir, known_paths)
File "/usr/lib/python2.6/site.py", line 185, in addsitedir
addpackage(sitedir, name, known_paths)
File "/usr/lib/python2.6/site.py", line 155, in addpackage
exec line
File "<string>", line 1, in <module>
File "/usr/lib/python2.6/site.py", line 185, in addsitedir
addpackage(sitedir, name, known_paths)
File "/usr/lib/python2.6/site.py", line 155, in addpackage
exec line
File "<string>", line 1, in <module>
File "/usr/lib/python2.6/site.py", line 185, in addsitedir
addpackage(sitedir, name, known_paths)
File "/usr/lib/python2.6/site.py", line 155, in addpackage
exec line
[...]
File "/usr/lib/python2.6/site.py", line 185, in addsitedir
addpackage(sitedir, name, known_paths)
File "/usr/lib/python2.6/site.py", line 155, in addpackage
exec line
File "<string>", line 1, in <module>
File "/usr/lib/python2.6/site.py", line 175, in addsitedir
sitedir, sitedircase = makepath(sitedir)
File "/usr/lib/python2.6/site.py", line 76, in makepath
dir = os.path.abspath(os.path.join(*paths))
RuntimeError: maximum recursion depth exceeded


What is going wrong with my python install? What do I have to change?

Thanks,
Sebastian
 
P

Peter Pearson

Hi all,

I am new to python and I don't know how to fix this error. I only try to
execute python (or a cgi script) and I get an ouptu like

[...]
'import site' failed; traceback:
Traceback (most recent call last):
File "/usr/lib/python2.6/site.py", line 513, in <module>
main()
File "/usr/lib/python2.6/site.py", line 496, in main
known_paths = addsitepackages(known_paths)
File "/usr/lib/python2.6/site.py", line 288, in addsitepackages
addsitedir(sitedir, known_paths)
File "/usr/lib/python2.6/site.py", line 185, in addsitedir
addpackage(sitedir, name, known_paths)
File "/usr/lib/python2.6/site.py", line 155, in addpackage
exec line
File "<string>", line 1, in <module>
File "/usr/lib/python2.6/site.py", line 185, in addsitedir
addpackage(sitedir, name, known_paths)
File "/usr/lib/python2.6/site.py", line 155, in addpackage
exec line
File "<string>", line 1, in <module>
File "/usr/lib/python2.6/site.py", line 185, in addsitedir
addpackage(sitedir, name, known_paths)
File "/usr/lib/python2.6/site.py", line 155, in addpackage
exec line
[...]
File "/usr/lib/python2.6/site.py", line 185, in addsitedir
addpackage(sitedir, name, known_paths)
File "/usr/lib/python2.6/site.py", line 155, in addpackage
exec line
File "<string>", line 1, in <module>
File "/usr/lib/python2.6/site.py", line 175, in addsitedir
sitedir, sitedircase = makepath(sitedir)
File "/usr/lib/python2.6/site.py", line 76, in makepath
dir = os.path.abspath(os.path.join(*paths))
RuntimeError: maximum recursion depth exceeded


What is going wrong with my python install? What do I have to change?

While we're waiting for the smart guys to notice your plea,
it will help if you identify your operating system and
show the command that you used to execute Python. The
parenthetical "or a cgi script" is mysterious to me.
 
J

John Machin

Hi all,

I am new to python and I don't know how to fix this error. I only try to
execute python (or a cgi script) and I get an ouptu like

[...]
'import site' failed; traceback:
Traceback (most recent call last):
File "/usr/lib/python2.6/site.py", line 513, in <module>
main()
File "/usr/lib/python2.6/site.py", line 496, in main
known_paths = addsitepackages(known_paths)
File "/usr/lib/python2.6/site.py", line 288, in addsitepackages
addsitedir(sitedir, known_paths)
File "/usr/lib/python2.6/site.py", line 185, in addsitedir
addpackage(sitedir, name, known_paths)
File "/usr/lib/python2.6/site.py", line 155, in addpackage
exec line
File "<string>", line 1, in <module>
File "/usr/lib/python2.6/site.py", line 185, in addsitedir
addpackage(sitedir, name, known_paths)
File "/usr/lib/python2.6/site.py", line 155, in addpackage
exec line
File "<string>", line 1, in <module>
File "/usr/lib/python2.6/site.py", line 185, in addsitedir
addpackage(sitedir, name, known_paths)
File "/usr/lib/python2.6/site.py", line 155, in addpackage
exec line
[...]
File "/usr/lib/python2.6/site.py", line 185, in addsitedir
addpackage(sitedir, name, known_paths)
File "/usr/lib/python2.6/site.py", line 155, in addpackage
exec line
File "<string>", line 1, in <module>
File "/usr/lib/python2.6/site.py", line 175, in addsitedir
sitedir, sitedircase = makepath(sitedir)
File "/usr/lib/python2.6/site.py", line 76, in makepath
dir = os.path.abspath(os.path.join(*paths))
RuntimeError: maximum recursion depth exceeded

What is going wrong with my python install? What do I have to change?

Reading the code for site.py, it looks like you may have a .pth file
that is self-referential (or a chain or 2 or more .pth files!) that
are sending you around in a loop. If you are having trouble
determining what files are involved, you could put some print
statements in your site.py at about lines 155 and 185 (which appear to
be in the loop, according to the traceback) or step through it with a
debugger.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top