2

I need to use conda to install some library to use with Colab. It seems that we cannot use the latest Anaconda because its Python 3.7 isn't compatable.

So what's latest compatible version for both Anaconda and Miniconda? And how to install them?

korakot
  • 37,818
  • 16
  • 123
  • 144
  • @merv I have edited it to Anaconda. Thanks! – korakot Apr 25 '19 at 03:44
  • 1
    FYI, once you get the alternate version of conda installed, you can create a separate environment to test with. This will avoid any clashes with other code you run. `!conda init` `!conda create -y -q --name test36 python=3.6`. Then you can use `%%bash` and `source activate myenv` to create a shell to run your python code from – Donald S Jun 17 '20 at 04:58

1 Answers1

3

The latest compatible versions are

  • Anaconda 5.2.0
  • Miniconda 4.5.4

Here's how to install them. I use an example installing faiss from pytorch channel.

!wget -c https://repo.continuum.io/archive/Anaconda3-5.2.0-Linux-x86_64.sh
!chmod +x Anaconda3-5.2.0-Linux-x86_64.sh
!bash ./Anaconda3-5.2.0-Linux-x86_64.sh -b -f -p /usr/local
# can change to another channel or package
!conda install -q -y --prefix /usr/local -c pytorch faiss-cpu
import sys
sys.path.append('/usr/local/lib/python3.6/site-packages/')
import faiss

For Miniconda

!wget -c https://repo.anaconda.com/miniconda/Miniconda3-4.5.4-Linux-x86_64.sh
!chmod +x Miniconda3-4.5.4-Linux-x86_64.sh
!bash ./Miniconda3-4.5.4-Linux-x86_64.sh -b -f -p /usr/local
!conda install -q -y --prefix /usr/local -c pytorch faiss-cpu
import sys
sys.path.append('/usr/local/lib/python3.6/site-packages/')

update 2019-12

Someone report bug. Here's the new code to install ujson, as an example.

!wget -c https://repo.anaconda.com/miniconda/Miniconda3-4.5.4-Linux-x86_64.sh
!chmod +x Miniconda3-4.5.4-Linux-x86_64.sh
!bash ./Miniconda3-4.5.4-Linux-x86_64.sh -b -f -p /usr/local
!conda install -q -y --prefix /usr/local python=3.6 ujson
import sys
sys.path.append('/usr/local/lib/python3.6/site-packages/')
import ujson
korakot
  • 37,818
  • 16
  • 123
  • 144