Jia Lu wrote: > Hi all > > I created a folder named *lib* and put a py file *lib.py* in it. > In the upper folder I created a py file as: > > <CODE> > import lib.lib > > def main(): > """ > __doc__ > """ > lib.lib.test() > > > # //////////////////////////////////////// > if __name__ == "__main__": > main() > > > But I got an error : > #.:python main.py > Traceback (most recent call last): > File "main.py", line 6, in ? > import lib.lib > ImportError: No module named lib.lib > > Why ?
You need to define a file __init__.py in your newly created lib directory. HTH Thin -- http://mail.python.org/mailman/listinfo/python-list