How to add something to PYTHONPATH? How to add something to PYTHONPATH? django django

How to add something to PYTHONPATH?


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>


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 sysif not PYSOLR_PATH in sys.path:    sys.path.append(PYSOLR_PATH)

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