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.

Use `conda run` to get the activated environment variables instead of activation using shell scripts

See original GitHub issue

This is probably an oversight, looking at the code in EnvironmentActivationService.getActivatedEnvironmentVariablesImpl, we seem to be using conda shell activation scripts to run python code. I guess this needs to be changed to use conda run as well.

@brettcannon @karthiknadig /cc

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
rchiodocommented, Mar 23, 2022

With latest bits, I did the following:

  • Create a new conda environment
  • Ran a kernel from a conda environment
  • Printed out sys.executable, sys.path, and os.environ to verify the correct environment was setup.
0reactions
rchiodocommented, Mar 23, 2022

I don’t think there’s a good way to verify this other than to debug it.

This code path is used by jupyter to do things like start a kernel for a conda environment, so doing that would verify it isn’t broken.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python - Activate conda env through shell script
I use 'source command' to run the shell script, it works: source shell_script.sh.
Read more >
activating conda environment in within a shell script
And when I run /bin/bash /etc/rc.local I get this error, and the conda environment fails to activate. CommandNotFoundError: Your shell has not ...
Read more >
Managing environments
These activation scripts are how packages can set arbitrary environment variables that may be necessary for their operation. You can also use the...
Read more >
I Finally Managed to Activate a Conda Environment in My ...
To initialize your shell, run $ conda init <SHELL_NAME> Currently supported shells are: - bash - fish - tcsh - xonsh - zsh...
Read more >
Activating conda environment over SSH
To initialize your shell, run $ conda init <SHELL_NAME> Currently supported shells are: - bash - fish - tcsh - xonsh - zsh...
Read more >

github_iconTop Related Medium Post

No results found

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