我需要使用 conda
安装一些与 Colab 一起使用的库。看来我们无法使用最新的 Anaconda,因为它的 Python 3.7 不兼容。
那么 Anaconda
和 Miniconda
的最新兼容版本是什么?以及如何安装它们?
最佳答案
最新的兼容版本是
- Anaconda 5.2.0
- Miniconda 4.5.4
以下是安装它们的方法。我使用一个从 pytorch channel 安装 faiss 的示例。
!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
对于 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/')
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
关于anaconda - 与 Google Colab 兼容的最新 conda 版本是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55828329/