在Google Colab中保存点子安装 [英] Saving pip installs in google colab

查看:265
本文介绍了在Google Colab中保存点子安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以将Google Collab中的软件包保存到我的Google云端硬盘?这样一来,我就不必在每次要使用软件包时都重新下载并重新安装软件包.

Is there a way to save packages in Google Collab to my Google Drive? This is so I won't have to re-download and re-install packages every time I want to use them.

推荐答案

要将已安装的配置保存到Google云端硬盘:

To save your the installed configuration to your Google Drive:

from google.colab import drive
drive.mount('/content/gdrive')
pip freeze --local > /content/gdrive/My\ Drive/colab_installed.txt

要从驱动器还原,请执行以下操作:

To restore from drive:

from google.colab import drive
drive.mount('/content/gdrive')
pip install --upgrade --force-reinstall `cat /content/gdrive/My\ Drive/colab_installed.txt`

这篇关于在Google Colab中保存点子安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆