Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am just getting into Python, and accidentally deleted my default PYTHONPATH. Can someone please tell me what paths are included in a clean Python install? Thanks!

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

Normal, "clean" installations of Python don't require the use of $PYTHONPATH: the default path embedded in the interpreter already contains all the locations that are needed to find the standard library. You can prove this by running Python directly with a blank value for $PYTHONPATH and asking it to output the path in use:

PYTHONPATH= python -c 'import sys; print(sys.path)'

You will get many directories of output from this.

If you have modules installed in non-standard locations (perhaps for example somewhere in your home directory because you are not root and don't have permission to install modules from PyPI in system directories) then you may indeed need a $PYTHONPATH to tell Python where to find these, but nobody else but yourself knows what these alternate locations are in your case.

share|improve this answer
    
Thanks! I appreciate the explanation. –  Thomas Jan 27 '13 at 20:22
add comment

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.