µWeb documentation - FAQ

ImportError: No module named uweb

Your mod_python is able to read your router, but stumbles when it tries to import the uweb package. Are you sure the path to your local copy of the uweb repository is inside the PYTHON_PATH, and that mod_python uses that path?

Python will look for a folder called uweb in the folders mentioned in the PythonPath when you try to import uweb, so make sure you set the route to the folder above uweb. When using Standalone, the PYTHON_PATH in your terminal doesn't help in finding the uweb package, resolve this by editing your bashrc.

In apache.conf

1<Directory "/var/www/mysite/">
2 PythonPath "['/path/to/parent/folder/of/uweb'] + sys.path"
3</Directory>

In ~/.bashrc

1export PYTHONPATH=/path/to/parent/folder/of/uweb
blog comments powered by Disqus