Skip to content

Instantly share code, notes, and snippets.

@vsreekanti
Created January 19, 2023 16:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vsreekanti/77bdfebbe09a714abd0d4218167dd9fe to your computer and use it in GitHub Desktop.
Save vsreekanti/77bdfebbe09a714abd0d4218167dd9fe to your computer and use it in GitHub Desktop.
Conda environment creation using an Aqueduct base environment
# Create a base Conda environment with Python 3.9 and the aqueduct-ml package.
# These steps sit outside of the critical path of running a function.
conda create -n aqueduct_py39 python==3.9
conda run -n aqueduct_py39 pip install aqueduct-ml
# Since the Python 3.9 runtime was already downloaded and cached when building
# the base image, this step now only takes 5 seconds.
conda create -n my_workflow_env python==3.9
# This command adds the site package path of aqueduct_py39 to the PYTHONPATH of
# my_workflow_env so that it can access packages installed in aqueduct_py39.
# Essentially, this command allows my_workflow_env to inherit aqueduct_py39.
# This step takes 1.1 seconds.
conda develop -n my_workflow_env <path_to_aqueduct_py39>/lib/python3.9/site-packages
# Now we just need to install the scikit-learn package.
conda run -n my_workflow_env pip install scikit-learn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment