Are Dispatcher routes broken in CherryPy for Mac?

Is CherryPy Broken? I just installed it and tried to use the route manager, but it has an import error, my code looks like this:

import cherrypy

mapper = cherrypy.dispatch.RoutesDispatcher()

Error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/jwesonga/environments/cherrypy/lib/python2.6/site-packages/CherryPy-3.2.2-py2.6.egg/cherrypy/_cpdispatch.py", line 463, in __init__
    import routes
ImportError: No module named routes

I am on a Mac and I tried both 3.2.2 and 3.0 using virtualenv for the latter.

+5
source share
1 answer

I have successfully used CherryPy with a route manager under OS X.

The error you indicated is:

ImportError: No module named routes

This is pretty clear - Python cannot find modules routes. Did you install it? This is not part of CherryPy, it is a separate module that you will need to install. If you are using MacPorts, you should be able to:

port install py-routes

( py25-routes py26-routes , Python ). virtualenv, :

easy_install routes
+6

All Articles