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.

Hooks in ${CONDA-PREFIX}/etc/conda/activate.d/ are not triggered

See original GitHub issue

Thanks for providing this plugin!

The activation/deactivation scripts that can be put into ${CONDA-PREFIX}/etc/conda/{de}activate.d/ do not get triggered when I switch to a kernel in jupyterhub. We are using nb_conda_kernels-2.2.2.

The activation scripts are correctly invoked when I do a conda activate myenv on the command line. The only workaround that I currently can think of is that users have to preload the missing part of the environment before their jupyter singleservers have been started by the hub. But this makes the whole kernel switching redundant, because it essentially prevents using another conda-env that needs a different environment. We want to use the activation hook system to combine the use of environment modules with conda-envs.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
fcollonvalcommented, Nov 23, 2019

@mcg1969 in light of the previous comment, do you have any suggestion for a fix?

The problem comes from: https://github.com/Anaconda-Platform/nb_conda_kernels/blob/f014e601115e652938dfac926a7e1698733e5ea1/nb_conda_kernels/manager.py#L193

0reactions
fcollonvalcommented, Nov 27, 2019

Thanks for the reply

Technically, running the script every time should not pose a problem, but Imam reluctant to check in a change that is either unnecessary or masks a different problem we should be fixing instead.

Make sense. I’ll try to find time to look into this a bit more.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I prevent Conda from activating the base environment ...
To disable auto activation of conda base environment in terminal: ... "$CONDA_PREFIX/etc/profile.d/conda.sh" break fi done.
Read more >
conda init and conda activate
target_prefix : the environment conda is running a command on. Usually defaults to the activated environment, unless -n (name) or -p (prefix) is...
Read more >
Conda activate scripts are not executed within ArcGIS
The crux of the problem is that activation scripts placed in %CONDA_PREFIX/etc/conda/activate.d by conda packages (such as pdal, proj, and so on) are...
Read more >
Using conda to version control cdk | by Alexis Lucattini | Medium
This applies even if the cdk project is not in python. ... mkdir -p "${CONDA_PREFIX}/etc/conda/activate.d". Now let's add in the activation ...
Read more >
How do I activate a conda environment in my .bashrc?
After this, When you open a new bash terminal, the conda environment will be "activated"/"enabled" by default. Note that you may not see...
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