是否可以将Google Collab中的软件包保存到我的Google云端硬盘?这样一来,我不必每次都要使用它们时都重新下载并重新安装软件包。
答案 0 :(得分:2)
要将已安装的配置保存到Google云端硬盘,
from google.colab import drive
drive.mount('/content/gdrive')
pip freeze --local > /content/gdrive/My\ Drive/colab_installed.txt
要还原:
from google.colab import drive
drive.mount('/content/gdrive')
pip install --upgrade --force-reinstall `cat/content/gdrive/My\ Drive/colab_installed.txt`