Skip to content

Commit

Permalink
fix conda env
Browse files Browse the repository at this point in the history
  • Loading branch information
urmi-21 committed Apr 29, 2020
1 parent 73aab61 commit 70a300e
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions pyrpipe/pyrpipe_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,17 @@ def init_envlog(self):
pyver='Python ' + sys.version.replace('\n', '')
#get cpu
cpu=str(cpu_count())+' logical CPU cores'
#get conda env
#get current conda environment and dump to log
condaenv_cmd='conda env export'
result = subprocess.Popen(condaenv_cmd.split(),stdout=subprocess.PIPE,stderr=subprocess.STDOUT,)
stdout,stderr = result.communicate()
condaenv=stdout.decode("utf-8")
#remove prefix line
condaenv='\n'.join([ x for x in condaenv.split('\n') if x and 'prefix' not in x ])
#print(condaenv)

try:
result = subprocess.Popen(condaenv_cmd.split(),stdout=subprocess.PIPE,stderr=subprocess.STDOUT,)
stdout,stderr = result.communicate()
condaenv=stdout.decode("utf-8")
#remove prefix line
condaenv='\n'.join([ x for x in condaenv.split('\n') if x and 'prefix' not in x ])
#print(condaenv)
except:
condaenv='Conda not found'

envDesc={'now':str(datetime.now().strftime("%y-%m-%d %H:%M:%S")),
'python':pyver,
Expand Down

0 comments on commit 70a300e

Please sign in to comment.