Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I downloaded a package (called pysolr 2.0.15) to my computer to be used with Haystack. The instructions asks me to add pysolr to my PYTHONPATH.

What exactly does that mean? After extracting the pysolr files, I ran the command python setup.py install and that's about it. What did that do and do I need to do anything else?

Thanks for the help!

share|improve this question
1  
You should add which operating system and python version you are using. –  Michael Mauderer Aug 14 '12 at 21:00
1  
Once the package is installed you shouldn't need to add anything to it. Are you sure you've diagnosed the problem properly? –  Ignacio Vazquez-Abrams Aug 14 '12 at 21:02
2  
Do you get any errors? python setup.py install should put the files in sys.path by itself. –  J.F. Sebastian Aug 14 '12 at 21:04

2 Answers 2

up vote 4 down vote accepted

The pythonpath tells python were to look for modules, for example you might have written a library that you want to use in several applications and stored it in the path /mylibs/python/ you would then have to add that path to the pythonpath for python to find it.

If you've downloaded a python module or library (I'm not really sure about the naming convention here) and you've just saved it in a random place on your computer, then you have to add it to your pythonpath.

However if you used easy_install or PIP then you dont have to worry.

To add something to the python-path in a *nix system you write:

export PYTHONPATH=$PYTHONPATH:/<path_to_modules>
share|improve this answer

Maybe, putting a path to pysolr to sys.path will do a work. Put this at settings.py or init.py of your django-project:

PYSOLR_PATH = '/path/to/pysolr/'
import sys
if not PYSOLR_PATH in sys.path:
    sys.path.append(ENGINE_PATH)

sys.path is a list of strings that specifies the search path for modules.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.