ImportError on startup

Bug #1286107 reported by Pablo Olmos
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
bobo
New
Undecided
Unassigned

Bug Description

I'm following the example from the Getting Started guide and i get this import error:

c:\>bobo -f dummy_server.py
Traceback (most recent call last):
  File "C:\Python27\Scripts\bobo-script.py", line 9, in <module>
    load_entry_point('bobo==2.0.0', 'console_scripts', 'bobo')()
  File "C:\Python27\lib\site-packages\pkg_resources.py", line 378, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "C:\Python27\lib\site-packages\pkg_resources.py", line 2566, in load_entry_point
    return ep.load()
  File "C:\Python27\lib\site-packages\pkg_resources.py", line 2260, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "C:\Python27\lib\site-packages\boboserver.py", line 29, in <module>
    import bobo
  File "C:\Python27\lib\site-packages\bobo.py", line 43, in <module>
    from six.moves import filter, urllib
ImportError: cannot import name urllib

I'm running python 2.7.3 on Windows 7. Installed bobo by "pip install bobo" which installed version 2.0 of bobo; pip also collected and installed WebOb 1.3.1.

A similar problem is reported in https://github.com/sosreport/sosreport/issues/218 with a potential solution provided in https://github.com/sosreport/sosreport/commit/6d867f95cca6f20b41684a3b96722f6f4f5d6e71 however, commenting out the urllib import causes bobo to load and crash with this error:

c:\>bobo -f dummy_server.py
Serving ['bobo__main__'] on port 8080...
ERROR:bobo:http://localhost:8080/
Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\bobo.py", line 202, in bobo_response
    return self.not_found(request, method)
  File "C:\Python27\lib\site-packages\bobo.py", line 275, in not_found
    "Could not find: " + urllib.parse.quote(
NameError: global name 'urllib' is not defined
sgurr120302.sgurrenergy.com - - [28/Feb/2014 12:10:19] "GET / HTTP/1.1" 500 97
ERROR:bobo:http://localhost:8080/favicon.ico
Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\bobo.py", line 202, in bobo_response
    return self.not_found(request, method)
  File "C:\Python27\lib\site-packages\bobo.py", line 275, in not_found
    "Could not find: " + urllib.parse.quote(
NameError: global name 'urllib' is not defined
sgurr120302.sgurrenergy.com - - [28/Feb/2014 12:10:20] "GET /favicon.ico HTTP/1.1" 500 97

If I start up a python interpreter, can import urllib without errors. Any ideas on why i cannot startup bobo?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.