code: def PyPackageDir(self, modulename):
          
  
          dirpath = ''
          if sys.version_info[0] < 3 or (sys.version_info[0] == 3 and sys.version_info[1] in (0,1,2,3,4)):
              # Python2 Code
              import imp
              splitname = modulename.split('.')
              srchpths = sys.path
              for item in splitname:
                  file, path, desc = imp.find_module(item, srchpths)
                  if file is not None:
                      path = os.path.dirname(path)
                  srchpths = [path]
              dirpath = path
          else:
              # Python3 Code
              import importlib.util
              modspec = importlib.util.find_spec(modulename)
              dirpath = os.path.dirname(modspec.origin)
          return self._lookup(dirpath, None, Dir, True)
docs: Locate the directory of a given python module name
  		
          For example scons might resolve to
          Windows: C:\Python27\Lib\site-packages\scons-2.5.1
          Linux: /usr/lib/scons
  
          This can be useful when we want to determine a toolpath based on a python module name