MCPcopy Create free account
hub / github.com/modelscope/modelscope / create_env

Method create_env

modelscope/utils/plugins.py:1250–1259  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1248 return False
1249
1250 def create_env(self):
1251 if not os.path.exists(self.env_dir):
1252 os.makedirs(self.env_dir)
1253 try:
1254 self.env_builder.create(self.env_dir)
1255 except Exception as e:
1256 self.clean_env()
1257 raise EnvironmentError(
1258 f'Failed to create virtual env at {self.env_dir} with error: {e}'
1259 )
1260
1261 def clean_env(self):
1262 if os.path.exists(self.env_dir):

Callers 1

test_create_envMethod · 0.80

Calls 3

clean_envMethod · 0.95
existsMethod · 0.45
createMethod · 0.45

Tested by 1

test_create_envMethod · 0.64