Error installing package with CONDA on colab

Viewed 726

I want to use CONDA to configure the environment on colab, so I first installed CONDA on colab:

!wget -qO ac.sh https://repo.anaconda.com/archive/Anaconda3-2020.07-Linux-x86_64.sh 
!bash ./ac.sh -b
!wget -O mini.sh https://repo.anaconda.com/miniconda/Miniconda3-py38_4.8.2-Linux-x86_64.sh
!chmod +x mini.sh
!bash ./mini.sh -b -f -p /usr/local

and then I run these codes:

!conda install -c conda-forge opencv
!conda install -c conda-forge pydicom

Opencv was successfully installed, but the following error occurred when installing pydicom:

Collecting package metadata (current_repodata.json): failed
InvalidVersionSpec: Invalid version '4.19.112+': empty version component

Strangely, this error only occurs when I install the package of conda-forge source and then install other packages with CONDA. What's more, this kind of mistake never happened before today.

Colab link: https://colab.research.google.com/drive/1VeMj6MdONymOPHEC72MFQ6E4X_inxC9E?usp=sharing

2 Answers

You could add the specific conda version you want to prevent it from being updated:

!conda install -c conda-forge opencv conda=4.9.2 

I have solved this problem by replacing the channel to prevent CONDA from automatically updating to 4.10.0 when installing the package. I've tried 4.9.2 and there won't be any problems.

Related