python package confusion

Devin Jeanpierre jeanpierreda at gmail.com
Mon Jul 23 12:22:45 CEST 2012


On Mon, Jul 23, 2012 at 6:02 AM, Lipska the Kat <lipska at lipskathekat.com> wrote:
> The PYTHONPATH ev is set to /home/lipska/python/dev/mods:.
> in .bashrc

Did you export it? Show us your .bashrc, or the relevant line in it
exactly. (And make sure that it isn't defined multiple times).

Also adding . to the import search path is probably a bad diea.

> lipska at ubuntu:~/python/dev/mods$ test.py
> Traceback (most recent call last):
>   File "./test.py", line 5, in <module>
>     fib(1000)
> NameError: name 'fib' is not defined

Neither of the files you described in your email message contain the
line "fib(1000)", so you pasted the wrong files.

> I also have an empty file __init__.py in the mods directory

This only matters if you want to "import mods".

-- Devin



More information about the Python-list mailing list