Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't find my PYTHONPATH

I'm trying to change my PYTHONPATH. I've tried to change it in "My Computer" etc, but it doesn't exist there. I searched in the registry in some places, and even ran a whole search for the word 'PYTHONPATH', but to no avail.

However, it Python I can easily see it exists. So where is it?

like image 472
R S Avatar asked May 13 '09 18:05

R S


1 Answers

At runtime, you can change it with:

import sys
sys.path.append('...')

In My Computer, right-click Properties (or press Win-Break), System tab, Environment Variables, System. You can add it if it's not already there.

Finally, in the CMD prompt:

set PYTHONPATH C:\Python25\Lib;C:\MyPythonLib

Or in bash:

PYTHONPATH=/usr/share/python/lib:/home/me/python
export PYTHONPATH

Or, more succinctly:

export PYTHONPATH=/home/me/python
like image 135
Lucas Jones Avatar answered Oct 09 '22 01:10

Lucas Jones