Posted By: Anonymous
I have a file called
tester.py, located on
/project has a subdirectory called
lib, with a file called
I want to import
tester. I have tried this:
Traceback (most recent call last): File "./tester.py", line 3, in <module> import lib.BoxTime ImportError: No module named lib.BoxTime
Any ideas how to import
BoxTime from the subdirectory?
__init__.py was the problem, but don’t forget to refer to
lib.BoxTime, or use:
import lib.BoxTime as BT ... BT.bt_function()
Take a look at the Packages documentation (Section 6.4) here: http://docs.python.org/tutorial/modules.html
In short, you need to put a blank file named
in the “lib” directory.