WebFaction
Community site: login faq

I have installed haystack under my home/user/lib/python2.6 directory and Django runs under python 2.7, when I enter the python shell outside the django project and import haystack it says django.conf not found. When I enter the python2.7 shell I can import django with no problems but cannot import haystack. My question:

Is there a way to use haystack in 2.6 together with django (2.7)? or the obvious Is it better to install Haystack and the backends again in 2.7?

Thanks for your reply.

asked 25 Aug '12, 19:03

arkt
313
accept rate: 0%


A python package is only available in the version of python for which it is installed. Since you installed haystack for python2.6, you are able to import it from within a python2.6 prompt. However, you are entirely disconnected from your Django app, which is running on python2.7 - this is why you get the "django configuration not found" error. If you enter your Django application and use python2.7 manage.py shell, you will enter the python2.7 shell with Django activated (that is, the django settings module is defined). However, since haystack is not installed for python2.7, the 'haystack' module is not found.

The solution is to install haystack for python2.7. Instructions for installing python packages under other versions of python are available in our documentation here. Hope that helps!

permanent link

answered 25 Aug '12, 20:08

ryans ♦♦
5.0k93360
accept rate: 43%

Thanks a lot, it is what I thought.

(26 Aug '12, 04:02) arkt

Now, Haystack shows in python2.7, but some of the submodules of haystack cannot be imported and therefore cannot be used with django, like views, do I have to add each one of the haystack submodules to the sys.path? Thanks again

(26 Aug '12, 06:26) arkt

Yes, that would probably be the case. See our Fixing ImportError guide and if you are still unable to make it work, please comment with the full error you are seeing or open a support ticket, so we can have a better look too.

(26 Aug '12, 06:38) iliasr ♦♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×909
×52
×7
×4

question asked: 25 Aug '12, 19:03

question was seen: 3,029 times

last updated: 26 Aug '12, 06:38

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM