Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Requested feature condacolab.install(yml="path/to/file.yml") #18

Open
rsanchezgarc opened this issue Nov 30, 2021 · 4 comments
Open

Requested feature condacolab.install(yml="path/to/file.yml") #18

rsanchezgarc opened this issue Nov 30, 2021 · 4 comments

Comments

@rsanchezgarc
Copy link

It would be super nice if we could get a one-liner to create an environment from a .yml file.

So far I am doing this

!pip install -q condacolab
import condacolab
condacolab.install() #ignore message about session crashing, this is intended
import condacolab
condacolab.check()
!wget -c https://raw.githubusercontent.com/XXXXXXXXX/master/environment.yml
!conda env update --file environment.yml

But I guess it should be easy to wrap it into
condacolab.install(yml = "environment.yml")

Thanks!

@jaimergp
Copy link
Member

jaimergp commented Feb 4, 2022

Ooops, I somehow never replied to this.

So this is tricky to implement. The install() function invokes a kernel restart, so we lose the connection to the server for a moment and then the process is restarted. That means that the environment installation cannot happen from the notebook until we are back alive.

We could prepare a script and set it to auto-launch after the restart or something like that, but it looks very fragile from my perspective. I would be happy to discuss this more thoroughly in a potential PR though!

@rsanchezgarc
Copy link
Author

Thanks @jaimergp for your answer. I am afraid I am not brave enough to start working on this.

@proppy
Copy link

proppy commented Oct 17, 2022

That means that the environment installation cannot happen from the notebook until we are back alive.

Does the installations needs to happen with the environment activated? Or would executing $CONDA_PREFIX/bin/conda env update --file environment.yml also work?

@jaimergp
Copy link
Member

That should work but you might need to add -p <PREFIX> to your command (I think it's /usr/local for the currently released version).

That said, @ssurbhi560 is working on this feature request at #38!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants