Support specifying a conda/virtual environment to use in the `LocalRun` run-config
See original GitHub issueWhen deploying a flow locally using a LocalRun
run-config, it would be useful to support running a flow using a different python environment than the one the agent is currently running. This would let users create and deploy flows using isolated environments (i.e. a conda environment per flow).
The types of environments we’d like to support:
- A conda environment, specified either by name or absolute path
- A virtual environment, specified by absolute path
- A python interpreter to use, specified by name on PATH (e.g.
python3.8
) or full path to interpreter
We could do this with either:
-
A single kwarg (
python_env
?) that takes in a URI where the scheme specifies the type of environment. This is also used bydask-yarn
, but may be non-intuitive. Examples:python_env="conda://my-env"
: a conda environment by namepython_env="conda:///full/path/to/env"
: a conda env by pathpython_env="venv:///full/path/to/venv"
: a virtual environment by pathpython_env="python:///full/path/to/python"
: full path to a python interpreter
-
One kwarg for each type. Specifying multiple kwargs is an error (can’t have both a conda and venv). Examples:
conda_env="my-env"
: a conda environment by nameconda_env="/full/path/to/env"
: a conda environment by full pathvirtual_env="/full/path/to/env"
: a virtual environment by full pathpython_env="/full/path/to/python"
: full path to a python interpreterpython_env="python3.8"
: python interpreter command name
I’m leaning towards the second option, as it seems clearer to me.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:16
- Comments:8
Top Results From Across the Web
IntelliJ IDEA - Configure a conda virtual environment - JetBrains
IntelliJ IDEA supports creating virtual environments for Python with Conda. The following procedure applies to all supported operating ...
Read more >Manage Azure Machine Learning environments with the CLI ...
Learn how to manage Azure ML environments using Python SDK and Azure CLI extension for Machine Learning.
Read more >Managing environments - Conda
See Specifying a location for an environment or run conda create --help for information on specifying a different path. Use the terminal or...
Read more >Running Python Program as Windows Service with a specific ...
I suspect that if I could activate the conda virtual environment as part of my python code, that would solve the problem. (I...
Read more >Introduction to Conda virtual environments
... of a good data science project. Many factors from setting random seeds, data versioning to using virtual environments can help improve the…...
Read more >
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
We’re implementing this in Orion, so I’ll close this for now.
Orion was our code name for the 2.0 version. This feature is included in 2.0a7. It won’t be included in 1.0.