Colab¶
安装路径都设置到 mount的google drive里¶
Mount Google Drive:
from google.colab import drive drive.mount('/content/gdrive') import os, sys nb_path = '/content/notebooks' os.symlink('/content/gdrive/My Drive/Colab Notebooks', nb_path) sys.path.insert(0, nb_path) # or append(nb_path)
Install the module in the notebook folder permanently:
!pip install --target=$nb_path spacy
【Usage】Mount your Google drive:
from google.colab import drive drive.mount('/content/gdrive') import sys sys.path.append('/content/gdrive/My Drive/Colab Notebooks')
参考¶
把安装路径都设置到 mount的google drive里,这样以后每次都只需要配置一下路径,不需要再重新安装pip包了: https://ayoolafelix.hashnode.dev/how-to-permanently-install-a-module-on-google-colab-ckixqrvs40su044s187y274tc