Forums

Getting error: ImportError: No module named wsgi

I have not loaded my site in a few months - it was working last time i checked, but now i'm getting this error.

ImportError: No module named wsgi

I have not spent anytime debugging, but I'm wondering if you see anything obvious.

thx!

I'm guessing you did an install with the --user flag when you set your application up. That was when PA was using Python 2.6 and now it is using Python 2.7. If you reinstall wsgi with the --user flag to Python 2.7 it should resolve your issue.

From the official PA FAQ:

How do I install new Python modules?

We've included both easy_install and pip for Python versions 2.6, 2.7 and 3.2 (the default is 2.6, add -2.7 or -3.2 at the end to specify the others), but you'll need to pass the --user flag to them, which will install modules to a directory (.local) inside your home folder. At present, we do not provide access to compilers, so only pure Python modules can be installed this way.

Do let us know if there are any packages you think should be part of our standard "batteries included".

We've also included virtualenv and virtualenvwrapper.

In this instance it might not be an install issue... I'm guessing that /var/www/wsgi.py cannot be imported.

Try running

python /var/www/wsgi.py

That will tell us what the underlying exception is. If you want to post the output of that here then we can help further.

Actually, doing some more Googling around. Yes try, installing django 1.4 inside your virtualenv for Python 2.7.