conda-incubator / condacolab

Install Conda and friends on Google Colab, easily
MIT License
341 stars 49 forks source link

Package is in conda list but cannot be imported #14

Closed thiel-ph closed 3 years ago

thiel-ph commented 3 years ago

Firstly, thank you for making this awesome package that allows for setting up conda on colab so elegant.

I set up the base environment with a .yml file. The process ran well, and I can see the package I need in conda list. But somehow I cannot import it.

This is a notebook for illustration: https://colab.research.google.com/drive/1Eq891W0g35-U2BrqXfDVyVDLHvfprJlL?usp=sharing

jaimergp commented 3 years ago

Thanks for your nice words! This looks like a problem with environment file shipped with ML-Turtle.

Colab forces us to stay with Python 3.7. We prevent accidental updates via pinning, but the env file asks for a specific version, conda assumes you know what you are doing. ML-Turtle's env file is asking for Python 3.9. This gets installed successfully, but in a different subdir we can't use because we can only use Python 3.7.

!conda knows how list these packages because ! is spawning a new process to run conda, which is now using Python 3.9. However, the old Python 3.7 interpreter is still alive in our Jupyter kernel and hence fails to see what has happened. Even if it could, it wouldn't work though.

TLDR: Provide a simpler environment file that can use Python 3.7.

thiel-ph commented 3 years ago

Thank you for the response, it worked 👌🏼