Setting PYTHONPATH from Makefile

Mike Meyer mwm at mired.org
Fri Dec 2 20:10:41 EST 2005


Inyeol Lee <inyeol.lee at siliconimage.com> writes:
> On Fri, Dec 02, 2005 at 07:33:20PM -0500, Mike Meyer wrote:
>> > 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
> How about using python -m?
> Assuming Make uses Bourne shell,
>
> %.abc: %.def
>     PYTHONPATH=/path/to/stuff:/path/to/another python -m myscript

That will break __name__ (at least with 2.4.2). Whether or not it
matters will depend on the script.

        <mike
-- 
Mike Meyer <mwm at mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.



More information about the Python-list mailing list