在 Deepnote 上安装 Conda

Ani*_*ket 2 python anaconda conda deepnote

我是一个相当缺乏经验的程序员,正在努力将 Conda 安装到Deepnote中。Pip install 不适用于某些软件包。例如,我正在尝试安装 rdkit,这是一个化学信息学软件包,它具有相当复杂的安装说明或通过 Anaconda/mini-conda 发行版管理的简单的 1 行代码。我真的很喜欢 Deepnote 笔记本,非常感谢这里的任何帮助。

\n

到目前为止,我在 Google Colab 上找到了用于 Conda 安装的有用代码:https://github.com/dataprofessor/code/blob/master/python/google_colab_install_conda.ipynb

\n
! wget https://repo.anaconda.com/miniconda/Miniconda3-py37_4.8.2-Linux-x86_64.sh\n! chmod +x Miniconda3-py37_4.8.2-Linux-x86_64.sh\n! bash ./Miniconda3-py37_4.8.2-Linux-x86_64.sh -b -f -p /usr/local\nimport sys\nsys.path.append(\'/usr/local/lib/python3.7/site-packages/\')\n
Run Code Online (Sandbox Code Playgroud)\n

虽然这在 Google Colab 上成功运行,但我不确定为什么它在 Deepnote 上失败,如下所示:

\n
--2020-12-04 22:58:34--  https://repo.anaconda.com/miniconda/Miniconda3-py37_4.8.2-Linux-x86_64.sh\nResolving repo.anaconda.com (repo.anaconda.com)... 104.16.130.3, 104.16.131.3, 2606:4700::6810:8203, ...\nConnecting to repo.anaconda.com (repo.anaconda.com)|104.16.130.3|:443... connected.\nHTTP request sent, awaiting response... 200 OK\nLength: 85055499 (81M) [application/x-sh]\nSaving to: \xe2\x80\x98Miniconda3-py37_4.8.2-Linux-x86_64.sh\xe2\x80\x99\n\nMiniconda3-py37_4.8 100%[===================>]  81.12M   133MB/s    in 0.6s    \n\n2020-12-04 22:58:35 (133 MB/s) - \xe2\x80\x98Miniconda3-py37_4.8.2-Linux-x86_64.sh\xe2\x80\x99 saved [85055499/85055499]\n\nPREFIX=/usr/local\n./Miniconda3-py37_4.8.2-Linux-x86_64.sh: line 392: /usr/local/conda.exe: Permission denied\nchmod: cannot access \'/usr/local/conda.exe\': No such file or directory\nUnpacking payload ...\n./Miniconda3-py37_4.8.2-Linux-x86_64.sh: line 404: /usr/local/conda.exe: No such file or directory\n./Miniconda3-py37_4.8.2-Linux-x86_64.sh: line 406: /usr/local/conda.exe: No such file or directory\n
Run Code Online (Sandbox Code Playgroud)\n

我还想做 conda install -c bioconda gromacs,但我找不到解决方法,所以我希望有人可以帮助我解决这个查询。

\n

提前谢谢了!

\n

PS 我使用的是 Mac 操作系统

\n

小智 5

您可以查看 Daniel Zvara 的笔记本

只需 3 个简单步骤即可在 Deepnote 中使用 Conda

总共

# 1. Install Conda and make Conda packages available in current environment

!wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
!chmod +x Miniconda3-latest-Linux-x86_64.sh
!sudo bash ./Miniconda3-latest-Linux-x86_64.sh -b -f -p /usr/local

import sys
sys.path.append('/usr/local/lib/python3.7/site-packages/')

# 2. Package installation
# !sudo conda install -y [EXTRA_OPTIONS] package_name

# So for example Keras from conda-forge channel
!sudo conda install -y -c conda-forge keras

# 3. Package usage

import keras
Run Code Online (Sandbox Code Playgroud)