File tree 1 file changed +5
-6
lines changed
1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change 2
2
import os
3
3
import subprocess
4
4
5
+ from bioemu .utils import get_conda_prefix
6
+
5
7
HPACKER_INSTALL_SCRIPT = os .path .join (
6
8
os .path .dirname (os .path .realpath (__file__ )), "setup_sidechain_relax.sh"
7
9
)
@@ -19,12 +21,9 @@ def ensure_hpacker_install(
19
21
Ensures hpacker and its dependencies are installed under conda environment
20
22
named `envname`
21
23
"""
22
- conda_root = os .getenv ("CONDA_ROOT" , None )
23
- if conda_root is None :
24
- # Attempt $CONDA_PREFIX_1
25
- conda_root = os .getenv ("CONDA_PREFIX_1" , None )
26
- assert conda_root is not None , "conda required to install hpacker environment"
27
- conda_envs = os .listdir (os .path .join (conda_root , "envs" ))
24
+ conda_root = get_conda_prefix ()
25
+ env_dir = os .path .join (conda_root , "envs" )
26
+ conda_envs = os .listdir (os .path .join (conda_root , "envs" )) if os .path .exists (env_dir ) else []
28
27
29
28
if envname not in conda_envs :
30
29
logger .info ("Setting up hpacker dependencies..." )
You can’t perform that action at this time.
0 commit comments