我是一个相当缺乏经验的程序员,正在努力将Conda安装到Deepnote中。Pip安装对某些包不起作用。例如,我正在尝试安装rdkit,这是一个化学信息学软件包,它有相当复杂的installation instructions或通过Anaconda/mini-conda发行版管理的一行简单代码。我真的很喜欢Deepnote笔记本,如果能帮上忙,我将非常感谢。
到目前为止,我在Google Colab上找到了用于安装Conda的有用代码:https://github.com/dataprofessor/code/blob/master/python/google_colab_install_conda.ipynb
! wget https://repo.anaconda.com/miniconda/Miniconda3-py37_4.8.2-Linux-x86_64.sh
! chmod +x Miniconda3-py37_4.8.2-Linux-x86_64.sh
! bash ./Miniconda3-py37_4.8.2-Linux-x86_64.sh -b -f -p /usr/local
import sys
sys.path.append('/usr/local/lib/python3.7/site-packages/')虽然这在Google Colab上工作成功,但我不确定为什么它会失败,如下所示的Deepnote:
--2020-12-04 22:58:34-- https://repo.anaconda.com/miniconda/Miniconda3-py37_4.8.2-Linux-x86_64.sh
Resolving repo.anaconda.com (repo.anaconda.com)... 104.16.130.3, 104.16.131.3, 2606:4700::6810:8203, ...
Connecting to repo.anaconda.com (repo.anaconda.com)|104.16.130.3|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 85055499 (81M) [application/x-sh]
Saving to: ‘Miniconda3-py37_4.8.2-Linux-x86_64.sh’
Miniconda3-py37_4.8 100%[===================>] 81.12M 133MB/s in 0.6s
2020-12-04 22:58:35 (133 MB/s) - ‘Miniconda3-py37_4.8.2-Linux-x86_64.sh’ saved [85055499/85055499]
PREFIX=/usr/local
./Miniconda3-py37_4.8.2-Linux-x86_64.sh: line 392: /usr/local/conda.exe: Permission denied
chmod: cannot access '/usr/local/conda.exe': No such file or directory
Unpacking payload ...
./Miniconda3-py37_4.8.2-Linux-x86_64.sh: line 404: /usr/local/conda.exe: No such file or directory
./Miniconda3-py37_4.8.2-Linux-x86_64.sh: line 406: /usr/local/conda.exe: No such file or directory我也想做conda安装-c bioconda gromacs,我找不到解决办法,所以我希望有人能帮我解决这个问题。
首先要感谢大家!
附注:我使用的是Mac OS
发布于 2021-01-10 11:08:00
您可以从Daniel Zvara查看此笔记本
Using Conda in Deepnote in 3 simple steps
总而言之
# 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发布于 2021-01-11 20:01:38
我还在Deepnote社区找到了另一个解决方案:https://community.deepnote.com/c/custom-environments/custom-environment-for-installing-conda-packages
可以使用以下Dockerfile设置自定义环境(只需填写所需包的占位符)。
FROM gcr.io/deepnote-200602/templates/deepnote
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh
RUN bash ~/miniconda.sh -b -p $HOME/miniconda
ENV PATH $HOME/miniconda/bin:$PATH
RUN conda install python=3.7 ipykernel -y
RUN conda install <insert packages here> -y
RUN python -m ipykernel install --user --name=conda
ENV DEFAULT_KERNEL_NAME "conda"Deepnote中的自定义环境是通过侧边栏中的environment选项卡设置的,为您提供了Dockerfile的选项。复制并粘贴上面的内容,然后单击build并重新启动机器-环境将设置为允许您使用conda。
https://stackoverflow.com/questions/65151990
复制相似问题