First time here? Check out the FAQ!
1

Error: 'No module named keyedcache'

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>/manage.py 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?

allanw's avatar
33
allanw
asked 2011-02-10 20:20:56 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

4 Answers

1

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

allanw's avatar
33
allanw
answered 2011-02-11 11:43:42 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments
0

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

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

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

Evgeny's avatar
13.2k
Evgeny
updated 2011-02-10 20:40:06 -0500, answered 2011-02-10 20:26:26 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments
0

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.

chorylee's avatar
1
chorylee
answered 2012-05-16 19:18:14 -0500
edit flag offensive 0 remove flag delete link

Comments

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 setup.py install or the same with the develop command. That way dependencies will be satisfied.

Evgeny's avatar Evgeny (2012-05-16 19:25:09 -0500) edit
add a comment see more comments
0

Yes, I ran python setup.py 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?

allanw's avatar
33
allanw
answered 2011-02-11 07:35:59 -0500
edit flag offensive 0 remove flag delete link

Comments

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 -0500) edit
add a comment see more comments