def get_package_path(package_name):
 try:
  __import__(package_name)
  return sys.modules[package_name].__path__[0]
 except AttributeError:
  raise AttributeError(('%r is not a package' % package_name))

def get_package_path ( package_name ) : try : __import__ ( package_name ) return sys . modules [ package_name ] . __path__ [ 0 ] except AttributeError : raise AttributeError ( ( '%r is not a package' % package_name ) )
import *package_name* .