473,395 Members | 1,978 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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.py", 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?
Oct 10 '08 #1
2 3707
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/
Oct 10 '08 #2
On Oct 10, 1:48*pm, Wojtek Walczak <gmin...@bzt.bztwrote:
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.
Oct 12 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Stian Sřiland | last post by:
all examples performed with: Python 2.3+ (#2, Aug 10 2003, 11:09:33) on linux2 (2, 3, 0, 'final', 1) This is a recursive import:
0
by: Vio | last post by:
Hi, I've been trying to embed (statically) wxPy alongside an embedded py interpreter on a linux/gtk box. At one point, for some reason misc.o linking reported "multiple definitions of...
0
by: John Roth | last post by:
I've found a case where it seems that Python is importing two copies of a module without any reason or indication. It took me a while to verify that this is what is occuring: I had to write a...
5
by: Steve Holden | last post by:
This is even stranger: it makes it if I import the module a second time: import dbimp as dbimp import sys if __name__ == "__main__": dbimp.install() #k = sys.modules.keys() #k.sort() #for...
4
by: metaperl | last post by:
The urlparse with Python 2.4.3 includes the user and pass in the site aspect of its parse: 'bill:james@docs.python.org' I personally would prefer that it be broken down a bit further. What...
0
by: Neville CD | last post by:
Basically I encountered some smallish problems with a couple of modules and figure I can fix the problems. I did find http://sourceforge.net/projects/python, should I report my problem report...
7
by: Ron Adam | last post by:
from __future__ import absolute_import Is there a way to check if this is working? I get the same results with or without it. Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) on win 32 ...
3
by: John Nagle | last post by:
Here's a hostile URL that "urlparse.urlparse" seems to have mis-parsed. ====...
9
by: rsoh.woodhouse | last post by:
Hi, I'm trying to work out some strange (to me) behaviour that I see when running a python script in two different ways (I've inherited some code that needs to be maintained and integrated with...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.