You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import covalent as ct
executor_test = ct.executor.LocalExecutor(
conda_env = 'conda_test',
current_env_on_conda_fail=False,
)
@ct.electron(executor=executor_test)
def test_task():
import test_module
# do something using test_module
@ct.lattice
def test_workflow():
return test_task()
In the above example, I defined a test executor with specified conda env called 'conda_test'. This executor is then used in the test_task. Inside the test_task, it tries to import some module (and do something using that module) that's available in 'conda_test' env, but not available to the current conda env. Finally this test_task is performed as a test_workflow. After dispatching this workflow, it throws import error about test_module.
In the above case, the test_module is not compatible with other packages in the current env and it cannot be properly installed, so that's why a separate conda evn was created to handle this situation.
I'm wondering if this is the correct way to use executor with specific conda env, or are there better solutions to deal with the above situation?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello Covalent community,
I'm trying an example following the guide at https://docs.covalent.xyz/docs/user-documentation/how-to/execution/choosing-conda-environments. However, I encountered an import error when the electron task tries to import a module installed in the specified conda env. Here is a toy example that I used:
In the above example, I defined a test executor with specified conda env called 'conda_test'. This executor is then used in the test_task. Inside the test_task, it tries to import some module (and do something using that module) that's available in 'conda_test' env, but not available to the current conda env. Finally this test_task is performed as a test_workflow. After dispatching this workflow, it throws import error about test_module.
In the above case, the test_module is not compatible with other packages in the current env and it cannot be properly installed, so that's why a separate conda evn was created to handle this situation.
I'm wondering if this is the correct way to use executor with specific conda env, or are there better solutions to deal with the above situation?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions