diff --git a/clearml_agent/helper/package/conda_api.py b/clearml_agent/helper/package/conda_api.py index 29ab8c1..3a7bf07 100644 --- a/clearml_agent/helper/package/conda_api.py +++ b/clearml_agent/helper/package/conda_api.py @@ -505,6 +505,8 @@ class CondaAPI(PackageManager): reqs.append(m) # if we have a conda list, the rest should be installed with pip, + # this means any experiment that was executed with pip environment, + # will be installed using pip if requirements.get('conda', None) is not None: for r in requirements['pip']: try: @@ -518,7 +520,7 @@ class CondaAPI(PackageManager): # skip over local files (we cannot change the version to a local file) if m.local_file: continue - m_name = m.name.lower() + m_name = (m.name or '').lower() if m_name in conda_supported_req_names: # this package is in the conda list, # make sure that if we changed version and we match it in conda @@ -555,7 +557,7 @@ class CondaAPI(PackageManager): # conform conda packages (version/name) for r in reqs: # change _ to - in name but not the prefix _ (as this is conda prefix) - if not r.name.startswith('_') and not requirements.get('conda', None): + if r.name and not r.name.startswith('_') and not requirements.get('conda', None): r.name = r.name.replace('_', '-') # remove .post from version numbers, it fails ~= version, and change == to ~= if r.specs and r.specs[0]: diff --git a/clearml_agent/helper/process.py b/clearml_agent/helper/process.py index d92348a..821b225 100644 --- a/clearml_agent/helper/process.py +++ b/clearml_agent/helper/process.py @@ -7,7 +7,7 @@ import re import subprocess import sys from contextlib import contextmanager -from copy import deepcopy +from copy import copy from distutils.spawn import find_executable from itertools import chain, repeat, islice from os.path import devnull @@ -276,9 +276,9 @@ class CommandSequence(Executable): self.commands = [] for c in commands: if isinstance(c, CommandSequence): - self.commands.extend(deepcopy(c.commands)) + self.commands.extend([copy(p) for p in c.commands]) elif isinstance(c, Argv): - self.commands.append(deepcopy(c)) + self.commands.append(copy(c)) else: self.commands.append(Argv(*c, log=self._log))