Source code for omegaml.mixins.store.package

[docs] 1class PythonPackageMixin(object): 2 """ 3 Install and load scripts 4 """
[docs] 5 def install(self, specs=None, keep=False): 6 """ 7 install and load packages 8 9 This is a convenience function to install one or more packages at once. 10 It is the equivalent of 11 12 for pkg in ['name1', 'name2']: 13 om.scripts.get(pkg) 14 15 Args: 16 specs (str, list): optional, package name or list of names, 17 defaults to self.list() 18 keep (bool): optional, will keep any packages installed in sys.path, 19 defaults to False 20 """ 21 specs = specs or self.list() 22 if isinstance(specs, str): 23 specs = specs.split(' ') 24 for pkgname in specs: 25 self.get(pkgname, keep=keep)