Conda env not activated
See original GitHub issueI am a bit confused by the way environment.yml
works.
I tried to install R and SageMath from conda-forge, with
name: sage-r-environment
channels:
- conda-forge
dependencies:
- python=2.7
- sage
- r-essentials
but when I launch the Jupyter server, neither R nor SageMath notebooks are available. SageMath also does not start from a terminal (it complains about some env variables not being set).
It seems that the reason is that the conda environment is not activated prior to launching the Jupyter server. The fix for me was to add a start
file:
#!/bin/bash
source /srv/conda/bin/activate kernel
exec "$@"
Also, the fact that the environment is named kernel
instead of sage-r-environment
is surprising.
Demo repo is here: https://github.com/defeo/sage-r
Is this a bug, or am I doing something wrong?
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (7 by maintainers)
Top Results From Across the Web
anaconda - Conda activate not working? - Stack Overflow
CommandNotFoundError: Your shell has not been properly configured to use 'conda activate '. If using 'conda activate' from a batch script, change ...
Read more >Conda environment activation not working in PowerShell #8428
As a workaround, there is an option in VS Code to select cmd.exe as the terminal application.
Read more >Managing environments - Conda
Activating environments is essential to making the software in the environments work well. Activation entails two primary functions: adding entries to PATH for ......
Read more >Conda environment is not activated properly in Terminal with ...
Set the project interpreter to the conda environment just created · Make sure Activate virtualenv is check in Settings -> Tools -> Terminal...
Read more >How to activate an Anaconda environment - Seminarsonly
This setting controls whether or not conda activates your base environment when it first starts up. You'll have the conda command available ...
Read more >Top Related Medium Post
No results found
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 FreeTop 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
Top GitHub Comments
hmmm that is strange - you shouldn’t need to do any
source
stuff in astart
file. E.g. here’s the binder-examples conda repo:https://github.com/binder-examples/conda/blob/master/environment.yml
Did you resolve this issue in the end, or still having problems with it? It feels like a bug to me…
@minrk did a bunch of work recently around activating conda environments at startup. Not sure if that applies to postBuild though. You can set your first line to
#!/bin/bash -l
to run a login Shell, which should activate the environment for you