Ask Your Question

Error: 'No module named keyedcache'

asked 2011-02-10 20:20:56 -0600

allanw's avatar

I'm in the process of setting up Askbot under Apache/mod_wsgi.

I cloned the Askbot repo into my virtualenv, then ran the startforum command and specified a project name. I can run the following command: bin/python <project_name>/ shell and then do 'import keyedcache' and it works fine.

However, when I try and access the site, I'm seeing the following error in the logs:

ImproperlyConfigured: Error importing middleware askbot.middleware.anon_user: "No module named keyedcache"

Anyone got any suggestions?

edit retag flag offensive close merge delete

4 Answers

Sort by ยป oldest newest most voted

answered 2012-05-16 19:18:14 -0600

To allanw: I have the same problem: ImproperlyConfigured: Error importing middleware askbot.middleware.anon_user: "No module named keyedcache"

My virtual host is based on mod_python, firstly I though it's the problem of mod_python. I have tried sevreal other open source applications and it works, so it should be not the issue of mod_python. Then I found your reply, and added "/path/to/site-packages" directory to my PYTHONPATH in the file ".htaccess", but it can't works. Could you help to explain your solution with more details, tks in advance.

edit flag offensive delete link more


It is either due to missing dependencies or lack of permissions to access the module files. First I would validate that django's runserver works in your case. If not - make sure that dependencies are satisfied, if yes - look into PYTHONPATH variable and/or file permissions. When you are installing askbot - please use either pip or python install or the same with the develop command. That way dependencies will be satisfied.

Evgeny's avatar Evgeny  ( 2012-05-16 19:25:09 -0600 )edit

answered 2011-02-11 11:43:42 -0600

allanw's avatar

Okay, this problem is now solved. I simply added the required site-packages directory to my PYTHONPATH.

edit flag offensive delete link more

answered 2011-02-11 07:35:59 -0600

allanw's avatar

Yes, I ran python develop. I'm starting to think that it might be a path issue, because if I add a logging statement to the django.wsgi file and output the contents of sys.path, I can see that it contains paths such as /usr/lib/python2.5/site-packages/Django-1.1-py2.5.egg/. The paths should be referring to the /lib/python.2.5/site-packages/ directory inside the virtualenv, shouldn't they?

edit flag offensive delete link more


With virtualenv this should not be a problem if you take python interpreter from the virtualenv/bin directory, instead of the site-wide interpreter
Evgeny's avatar Evgeny  ( 2011-02-11 13:01:13 -0600 )edit

answered 2011-02-10 20:26:26 -0600

Evgeny's avatar

updated 2011-02-10 20:40:06 -0600

Assuming that you have cloned the repository to get the code...

Did you run python develop? It should install all the dependencies and keep askbot app in the current directory.

There are several of dependencies - all listed in, except one - 'postgresql_psycopg2' - they can be installed manually too, but normally that should not be necessary.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2011-02-10 20:20:56 -0600

Seen: 1,033 times

Last updated: May 16 '12