conda-incubator / condacolab

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

Conda not installing package for Python 3.9, getting package for Python 3.8 instead #51

Closed AlbertoCasasOrtiz closed 1 year ago

AlbertoCasasOrtiz commented 1 year ago

I am installing condacolab:

!pip install -q condacolab
import condacolab
condacolab.install()

And then installing my package:

!conda install -c opensim_admin opensim

But the version installed by conda is for Python 3.8.

opensim-4.4 | py38np120

python --version returns Python 3.9.16, and !conda info returns python version : 3.9.16.final.0. Also, I can confirm that the package for Python 3.9 exists because when I install it specifying the version and tag, it install the proper package:

conda install -c opensim_admin opensim=4.4=py39np120

This installs the correct version opensim-4.4 | py39np120 and my code works.

Could it be that condacolab / conda is not retrieving the correct packages?

jaimergp commented 1 year ago

Hi @AlbertoCasasOrtiz, can you share a notebook with the problem reproducer so I can take a look? Thanks 🙏

AlbertoCasasOrtiz commented 1 year ago

Sure! Here there is a notebook with this problem:

https://colab.research.google.com/drive/1rKO-4HTl3Y6voafSESE22Guxev0bQLlT?usp=sharing

Thank you.

jaimergp commented 1 year ago

I can reproduce locally, without condacolab and outside Colab, so this is not a problem with condacolab itself.

That said, I can explain why you are seeing this issue. While the latest builds of opensim are correctly restricting python's version, there's a previous version with an open python dependency:

image

mamba does exhibit the behaviour you want, and is included in the default installation, so feel free to use it instead:

!mamba install -c opensim-org opensim

The other alternative is to restrict opensim to a py39 build explicitly: conda install -c opensim-org 'opensim=*=*py39*'.

The last option is to rebuild the offending packages (underspecified python constraints) and remove the main label from the old ones.

This is the one being selected.

AlbertoCasasOrtiz commented 1 year ago

Thank you for investigating this @jaimergp, we will try to fix the package on our side and use mamba instead until we fix it.

I am closing this issue. Thanks again!