| 63 | |
| 64 | # function to create the environment ofr an anaconda environment |
| 65 | def create_env(): |
| 66 | # create env |
| 67 | temp_dir = tempfile.mkdtemp() |
| 68 | env_path = Path(temp_dir).absolute() |
| 69 | sys.stderr.write(f"Creating Virtual Environment with path: {env_path}...\n") |
| 70 | execute(f"conda create --prefix {env_path} python=3.7 -y") |
| 71 | python_path = env_path / "bin" / "python" # TODO: FIX ME! |
| 72 | sys.stderr.write("\n") |
| 73 | # get anaconda activate path |
| 74 | conda_activate = Path(os.environ["CONDA_PREFIX"]) / "bin" / "activate" # TODO: FIX ME! |
| 75 | return temp_dir, env_path, python_path, conda_activate |
| 76 | |
| 77 | |
| 78 | # function to execute the cmd |