Not finding user-installed module despite PYTHONPATH!

Adam Langley usenet at imperialviolet.org
Thu Nov 28 10:50:56 EST 2002


On Thu, 28 Nov 2002 14:51:09 +0000, Albert Hofkamp wrote:

> Obviously, 'import' looks for mymodule in the python module searchpaths.
> Since mymodule is not (yet :-) ) part of the python standard distribution,
> I did a user-install (the home scheme of distutils) of the module at
> $HOME/python.
> I added the searchpath to the module into PYTHONPATH in my shell rc file
> (export PYTHONPATH=$HOME/python/lib/python:.).
> (both .bashrc and .zshrc (as well as the login scripts (.bash_profile,
> .zlogin) to be on the safe side))
> 
> At my Linux (RH7.2) system, this approach works with bash.
> It does _NOT_ work with zsh.

I think you'll find that ssh runs the command via the system default shell
(usually bash on Linux) and not via *your* default shell. Thus zsh startup
files aren't parsed.

However, $HOME/.ssh/environment can be used. From the manpage:

Additionally, ssh reads $HOME/.ssh/environment, and adds lines of the
format ``VARNAME=value'' to the environment if the file exists and 
users are allowed to change their environment.  See 
the PermitUserEnvironment option in sshd_config(5).





More information about the Python-list mailing list