urlparse import Faillure

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Robert Hancock

    urlparse import Faillure

    Python 2.5.2 (r252:60911, Aug 28 2008, 23:51:17)
    [GCC 4.3.0 20080428 (Red Hat 4.3.0-8)] on linux2
    Type "help", "copyright" , "credits" or "license" for more information.
    >>import CGIHTTPServer
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/usr/local/lib/python2.5/CGIHTTPServer.p y", line 28, in
    <module>
    import urllib
    File "/usr/local/lib/python2.5/urllib.py", line 30, in <module>
    from urlparse import urljoin as basejoin
    File "/usr/local/lib/python2.5/urlparse.py", line 3, in <module>
    See RFC 1808: "Relative Uniform Resource Locators", by R.
    Fielding,
    ImportError: cannot import name urlparse
    >>>
    urlparse.py
    """Parse (absolute and relative) URLs.

    See RFC 1808: "Relative Uniform Resource Locators", by R. Fielding,
    UC Irvine, June 1995.
    """

    __all__ = ["urlparse", "urlunparse ", "urljoin", "urldefrag" ,
    "urlsplit", "urlunsplit "]

    It points to the third line of the comment. Any ideas on how to
    proceed with the debugging?
  • Wojtek Walczak

    #2
    Re: urlparse import Faillure

    On Thu, 9 Oct 2008 22:47:58 -0700 (PDT), Robert Hancock wrote:
    >>>import CGIHTTPServer
    ....
    ImportError: cannot import name urlparse
    >>>>
    ....
    It points to the third line of the comment. Any ideas on how to
    proceed with the debugging?
    Have you tried getting rid of this comment? I doubt that
    the comment is a reason of this error, but it seems that
    it shadows the real problem. Moreover, try to import urlparse
    itself and check if you got the pyc file for urlparse.py
    in your */lib/python2.5/ directory.

    --
    Regards,
    Wojtek Walczak,
    Cena domeny: 4999 PLN (do negocjacji). Możliwość kupna na raty od 624.88 PLN miesięcznie. Oferta sprzedaży znajduje się w serwisie Aftermarket.pl, największej giełdzie domen internetowych w Polsce.

    Comment

    • Robert Hancock

      #3
      Re: urlparse import Faillure

      On Oct 10, 1:48 pm, Wojtek Walczak <gmin...@bzt.bz twrote:
      On Thu, 9 Oct 2008 22:47:58 -0700 (PDT), Robert Hancock wrote:
      >>import CGIHTTPServer
      ...
      ImportError: cannot import name urlparse
      >
      ...
      It points to the third line of the comment.  Any ideas on how to
      proceed with the debugging?
      >
      Have you tried getting rid of this comment? I doubt that
      the comment is a reason of this error, but it seems that
      it shadows the real problem. Moreover, try to import urlparse
      itself and check if you got the pyc file for urlparse.py
      in your */lib/python2.5/ directory.
      >
      --
      Regards,
      Wojtek Walczak,http://tosh.pl/gminick/
      It turns out that I had a script named urlparse.py in my path in
      another directory. I'm still not sure why the traceback pointed to
      the comment.

      Comment

      Working...