Runtime error

Discussion in 'Python' started by Sebastian, Oct 28, 2010.

  1. Sebastian

    Sebastian Guest

    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
    Sebastian, Oct 28, 2010
    #1
    1. Advertising

  2. On Thu, 28 Oct 2010 18:26:49 +0200, Sebastian <> wrote:
    > 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.

    --
    To email me, substitute nowhere->spamcop, invalid->net.
    Peter Pearson, Oct 30, 2010
    #2
    1. Advertising

  3. Sebastian

    John Machin Guest

    On Oct 29, 3:26 am, Sebastian <> wrote:
    > 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.
    John Machin, Oct 30, 2010
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Polo Lee
    Replies:
    0
    Views:
    2,722
    Polo Lee
    Jul 7, 2003
  2. Yongsub Eric Shin
    Replies:
    7
    Views:
    856
    Martin
    Jan 14, 2004
  3. Kevin Farless
    Replies:
    13
    Views:
    15,206
    chesterchass
    Oct 3, 2007
  4. Krunom Ancini
    Replies:
    2
    Views:
    5,163
  5. Hal Vaughan
    Replies:
    11
    Views:
    1,105
    Gordon Beaton
    May 22, 2006
Loading...

Share This Page