Ask Your Question
1

Error: 'No module named keyedcache'

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

allanw gravatar image allanw
33 2 6

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?

delete close flag offensive retag edit

4 Answers

Sort by ยป oldest newest most voted
1

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

allanw gravatar image allanw
33 2 6

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

link publish delete flag offensive edit
0

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

Evgeny gravatar image Evgeny flag of Chile
11009 50 84 182
http://askbot.org/

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

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.

link publish delete flag offensive edit
0

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

allanw gravatar image allanw
33 2 6

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?

link publish delete flag offensive edit

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 ( 2011-02-11 13:01:13 -0500 )edit
0

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

chorylee gravatar image chorylee
1

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.

link publish delete flag offensive edit

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 ( 2012-05-16 19:25:09 -0500 )edit

Your answer

Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Reliable Askbot Hosting

Create your Q&A site at askbot.com. Managed Askbot hosting at just $15/mo. Dedicated hosting, support contracts, consulting services.

create your Q&A site
30 days free trial

Question tools

Follow
1 follower

subscribe to rss feed

Stats

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

Seen: 218 times

Last updated: May 16 '12