Setting PYTHONPATH from Makefile

pinkfloydhomer at gmail.com pinkfloydhomer at gmail.com
Fri Dec 2 09:28:31 EST 2005


I have a Makefile target that uses a python script, like:

%.abc: %.def
        python myscript.py

The problem is that myscript.py and some modules that myscript.py
imports are not in the current directory, but in another place in the
filesystem, say, /path/to/stuff. If this was a tcsh script, I would
just do:

       setenv PYTHONPATH /path/to/stuff
       python myscript.py

but this cannot be done from a Makefile. So what do I do? Is there
another way to set the PYTHONPATH? Like giving an option to "python"
itself? Or?

/David




More information about the Python-list mailing list