For normal, self contained dependent modules, you would normally only need to copy the dependent modules or packages into a path relative to your script (such as a 'Modules' subfolder), and import with a relative import statement. For example:
from .Modules import submodule
But some packages make assumptions that they or their dependencies are located in the system path. In that case, if you attempt to import the module or package, it will import dependencies or it's own modules with absolute imports (instead of relative imports), and that will fail if the parent folder of the module/package is is not in the system path.
In this case, you have two options. The first is to edit the module/package code so that it uses relative imports on its sub/dependent module imports. In some cases this is relatively easy. But in many cases it is non trivial, and in cases of compiled modules it may be impossible without rebuilding it. The second option is to modify the system path to include your 'Modules' subfolder before importing.
If possible, modifying the module/package to use relative imports would be preferable. Modifying the system path is simpler, but it can affect the module resolution behavior of other addins or scripts (because they are all sharing the same runtime). If multiple scripts/addins import a module/package with the same name using an absolute import with a modified system path, they will collide and cause failures for one of them (if they are not the same module/package or the same version). So if you do modify the system path, do so only around the import (or around any calls that may result in an import that expects it if there are inlined imports). Make sure to revert your changes to the system path before returning control to the runtime. For example, I was able to import svgwrite by copying it and the pyparsing.py module into a 'Modules' subfolder in a script and importing it with the following:
modules = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'Modules')
sys.path.insert(0, modules)
from .Modules import svgwrite
popped = sys.path.pop(0)
assert(popped == modules)
Kris
Kris Kaplan