question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support specifying a conda/virtual environment to use in the `LocalRun` run-config

See original GitHub issue

When 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 by dask-yarn, but may be non-intuitive. Examples:

    • python_env="conda://my-env": a conda environment by name
    • python_env="conda:///full/path/to/env": a conda env by path
    • python_env="venv:///full/path/to/venv": a virtual environment by path
    • python_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 name
    • conda_env="/full/path/to/env": a conda environment by full path
    • virtual_env="/full/path/to/env": a virtual environment by full path
    • python_env="/full/path/to/python": full path to a python interpreter
    • python_env="python3.8": python interpreter command name

I’m leaning towards the second option, as it seems clearer to me.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:16
  • Comments:8

github_iconTop GitHub Comments

4reactions
madkinszcommented, Dec 13, 2021

We’re implementing this in Orion, so I’ll close this for now.

1reaction
madkinszcommented, Feb 16, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found