import sys
print sys.path
['D:\\zjm_code\\register2', 'C:\\WINDOWS\\system32\\python25.zip', 'D:\\Python25\\DLLs', 'D:\\Python25\\lib', 'D:\\Python25\\lib\\plat-win', 'D:\\Python25\\lib\\lib-tk', 'D:\\Python25', 'D:\\Python25\\lib\\site-packages']
and
#from django.core.management import setup_environ
from register2 import settings
#setup_environ(settings)
Traceback (most recent call last):
File "D:\zjm_code\register2\b.py", line 4, in <module>
from register2 import settings
ImportError: No module named register2
why ,
thanks
When directory
'D:\\zjm_code\\register2'is onsys.path, this means you can import modules and packages that are INSIDE that directory.To import the directory
register2itself, two conditions:'D:\\zjm_code', must be onsys.path; and'D:\\zjm_code\\register2\\__init__.py'must exist__init__.pyis the code that actually executes when you “import the directory”.