Re: [Pyunit-interest] error: can't open file <filename.py>
Brought to you by:
purcell
|
From: Steve P. <ste...@ya...> - 2002-01-22 08:13:10
|
Srikanth Mandava wrote: > > I'm running from a shell script after setting the PYTHONPATH. I get > a "can't open file <filename.py' "error even though the file is in the > PYTHONPATH. Any help is appreciated. Hi Srikanth, This type of question is probably best sent to the general python mailing list (see 'python-list' at http://mail.python.org/mailman/listinfo). My guess, though, is that your shell script contains something like: export PYTHONPATH=/some/directory python filename.py and that 'filename.py' is in '/some/directory'. Then, you are running the script from a different directory, and expecting that python will find 'filename.py' using 'PYTHONPATH'. This won't work, because Python doesn't use 'PYTHONPATH' to find scripts passed on the command-line; it only uses 'PYTHONPATH' to find modules loaded after the main script has started to run. Probably a better solution for you is simply: python /some/directory/filename.py Best of luck, -Steve -- Steve Purcell, Pythangelist Get testing at http://pyunit.sourceforge.net/ |