importing modules from alternate path

R. David Murray rdmurray at bitdance.com
Tue Mar 24 12:33:57 CET 2009


=?UTF-8?Q?Alexandru__Mo=C8=99oi?= <brtzsnr at gmail.com> wrote:
> I'm trying with no succes to load modules from an alternate path. When
> installing to default location (no --home specifed) everything works
> as expected.
> 
> $ python setup.py install --home=~
> running install
> running build
> running build_ext
> running install_lib
> running install_egg_info
> Removing /home/voodoo/lib/python/PackageName-1.0-py2.6.egg-info
> Writing /home/voodoo/lib/python/PackageName-1.0-py2.6.egg-info
> 
> $ printf "import demo" | PYTHONPATH=~ python
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> ImportError: No module named demo
> 
> $ printf "import demo" | PYTHONHOME=~ python
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> ImportError: No module named demo
> 
> 
> Any idea why alternate path is not working?

Possibly because the package gets installed into ~/lib/python, but
you haven't put that directory onto the PYTHONPATH.

--
R. David Murray           http://www.bitdance.com




More information about the Python-list mailing list