Python: deletion of item in sys.path is undone each time I restart the interpreter

path, python, python-2.7, pythonpath

Solution

sys.path is populated from the externally maintained PYTHONPATH variable. Change this variable to get a permanent change when you restart python.

On unix (including Macs) when using bash it's configured most likely like this:

export PYTHONPATH=....

And this statement is most likely hiding in your .profile or .bashrc file.

To do this in Windows you need to do something like

SET PYTHONPATH=....

And it's probably somewhere in the system control panel - under environment.

If you want to see your current setting for PYTHONPATH, go to command (terminal) window and type `echo $PYTHONPATH` (unix) or `echo %PYTHONPATH%` (windows)

Problem

``` >>> sys.path[6] /path/to/django >>> sys.path.pop(6) /path/to/django ``` Then `CTRL + D` ``` $ python >>> sys.path[6] /path/to/django ``` O dear...

Original source