Not finding user-installed module despite PYTHONPATH!

Robin Munn rmunn at pobox.com
Fri Nov 29 14:08:42 EST 2002


Albert Hofkamp <hat at se-46.wpa.wtb.tue.nl> wrote:
> Hello all,
> 
> I want to run an interactive Python module through ssh. The basic solution is
> something like
> 
> ssh -x remote_machine 'python -c "import mymodule ; mymodule.run()"'

[snip attempts to get PYTHONPATH set]

Does something like this work?

ssh -x remote_machine 'PYTHONPATH=/path/to/module python -c "import mymodule ; mymodule.run()"'

(If that line wraps, it should be all on one line).

It seems to me that this might be a better solution than trying to set
.ssh/environment -- do you want *all* ssh sessions to get this
PYTHONPATH, or just this particular command?

I like to be as specific as possible, and not apply a too-general
solution that might not make sense in another case.

-- 
Robin Munn <rmunn at pobox.com>
http://www.rmunn.com/
PGP key ID: 0x6AFB6838    50FF 2478 CFFB 081A 8338  54F7 845D ACFD 6AFB 6838



More information about the Python-list mailing list