首页 > 解决方案 > 与 Google Colab 兼容的最新 conda 版本是什么

问题描述

我需要使用conda安装一些库来与 Colab 一起使用。似乎我们不能使用最新的 Anaconda,因为它的 Python 3.7 不兼容。

那么 和 的最新兼容版本是Anaconda什么Miniconda?以及如何安装它们?

标签: anacondacondagoogle-colaboratoryminiconda

解决方案


最新的兼容版本是

  • 蟒蛇5.2.0
  • 迷你康达 4.5.4

以下是如何安装它们。我使用faiss从 pytorch 频道安装的示例。

!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

对于迷你康达

!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/')

更新 2019-12

有人报告错误。以下是要安装的新代码ujson,例如。

!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

推荐阅读