I am not an expert in Python, but one way to debug this is to launch the python prompt, and do import myModule
then, some simple command that uses that module's constructs. If this works then your module installation is not the issue. If not your module wasnt installed.
You should see more than just the directory creation /usr/lib/python2.4/site-packages
.
Did you tell python to look under /usr/lib/python2.4/site-packages/MyModule/
for your module(s)? (You need to put a *.pth file in /usr/lib/python2.4/site-packages/
for that, or maybe you should not put them into an extra directory.)
Try the following in a python shell:
>>> import sys
>>> sys.path
What does that print? Does it include '/usr/lib/python2.4/site-packages/MyModule'
?
You can check that the Python interpreter that you are calling sees your module by doing:
/usr/bin/python -c "import MyModule"
This command should simply import MyModule/__init__.py
and not complain about MyModule not being found.
Since there are many modules in your code, you actually want to create a package, not a module.
To do so, you can simply add an empty __init__.py
file in MyModule/ and all its subpackages, so as to indicate that you have a package (i.e. is a folder that contains many modules).
If your ttLib is in MyModule/myModule/ttLib/, you can do the same and add an empty __init__.py
file in MyModule/ and MyModule/myModule/, so as to declare that MyModule and MyModule/myModule are packages; you can then simply do:
from MyModule.myModule.ttLib import …
Hope this helps! The full documentation for packages can be found on the official site.
I reinstalled the module and everything works fine. It seems the module was not installed correctly.