Issue
I am having trouble getting django-haystack installed on my production server.
I get the error No module named haystack
when I run any of the following commands:
python manage.py syncdb
python manage.py runserver
python manage.py shell
This is a clone of an existing project running on a development server, so I believe my settings.py is configured correctly.
I am working inside a virtualenv. I have tried uninstalling and reinstalling django-haystack several times using pip.
What could be causing this error?
UPDATE:
Got some more data from following these steps:
Inside virtualenv: pip freeze
- django-haystack is not listed.
Outside virtualenv: pip freeze
- django-haystack is listed.
Outside virtualenv: sudo pip uninstall django-haystack
Outside virtualenv: pip freeze
- django-haystack is not listed.
Inside virtualenv: which pip
- /home/{user}/.virtualenvs/{virtualenv}/bin/pip
Inside virtualenv: sudo pip install django-haystack
Inside virtualenv: pip freeze
- django-haystack is still not listed.
Outside virtualenv: pip freeze
- django-haystack is listed.
Curious isn't it?
I am using virtualenvwrapper (if you couldn't tell from the pip path)
Why is pip installing it (and some other packages I noticed) outside my virtualenv?
Solution
Found answer here: Python packages not installing in virtualenv using pip
The problem was that I was using sudo with pip in my virtualenv. As a result, pip was installing outside of my virtualenv.
Answered By - roob Answer Checked By - Mildred Charles (WPSolving Admin)