Import python modules given direct path -
i have module __init__.py
located in specific path. i:
import sys sys.path.append('c:/users/me/dropbox/python/library/moduledir')
but when from moduledir.x import classa
, doesn't recognize statement meaning wasn't able find module. missing?
under moduledir
:
moduledir __init__.py x.py subdir __init__.py y.py
you need add directory containing package subdir path:
sys.path.append('c:/users/me/dropbox/python/library')
see docs.