纪念下在googlecolab上为一个项目配置环境的经历

此前读到一篇药物靶点亲和度预测的文章,决定复现下试试,不料环境极其难配置,尤其Rekit这个库包,配了3天仍然出错。记录下过程。

第一步安装Anaconda环境:

!wget -c https://repo.anaconda.com/miniconda/Miniconda3-py37_4.9.2-Linux-x86_64.sh
!chmod +x Miniconda3-py37_4.9.2-Linux-x86_64.sh
!time bash ./Miniconda3-py37_4.9.2-Linux-x86_64.sh -b -f -p /usr/local
!time conda install -q -y -c conda-forge rdkit==2020.09.2

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

我用的是python=3.7的环境

第二步:安装torch

!pip install networkx
!pip install torch
!pip install scipy
!pip install torch_sparse
!pip install torch-cluster
!pip install torch-spline-conv
!pip install torch_scatter
!pip install torch_geometric

对于后面的四个软件包,本来我用官网的命令一起安装的,而且安装成功,但仍然说我没安装

!pip install torch-scatter torch-sparse torch-cluster torch-spline-conv torch-geometric -f https://data.pyg.org/whl/torch-1.10.0+cpu.html

很无奈,就一句一句安装,

部装完了,终于好了,这个时候,一件悲催的事,colab不分配GPU给我了,我屮艸芔茻

补充查看版本以及是是否可用

import torch
print(torch.__version__)
print(torch.cuda.is_available())
!pip install "/content/torch_cluster-1.5.9-cp37-cp37m-linux_x86_64.whl"
!pip install "/content/torch_scatter-2.0.9-cp37-cp37m-linux_x86_64.whl"
!pip install "/content/torch_sparse-0.6.12-cp37-cp37m-linux_x86_64.whl"
!pip install "/content/torch_spline_conv-1.2.1-cp37-cp37m-linux_x86_64.whl"

  • 1
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 7
    评论
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值