Skip to content Skip to sidebar Skip to footer

Python: Forcing Relative Imports To Search From Script File

This is my directory structure: scripts/ bpydata/ bpymodules/ myCustomScripts/ lib/ __init__.py customLib.py plugin/ __init__.py my

Solution 1:

To import from a parent package use ... If I'm not misunderstanding you, this should work:

from ..libimport customLib

See http://docs.python.org/tutorial/modules.html.

Post a Comment for "Python: Forcing Relative Imports To Search From Script File"