Created
December 21, 2020 03:36
-
-
Save Justus-coded/0c7267937614658cf7e5ae794ffa1b31 to your computer and use it in GitHub Desktop.
Installing a module permanently in Google colab
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, sys | |
from google.colab import drive | |
drive.mount('/content/gdrive') | |
#create a path to save the module | |
nb_path = '/content/notebooks' | |
os.symlink('/content/gdrive/My Drive/Colab Notebooks', nb_path) | |
sys.path.insert(0, nb_path) | |
#isntall the module in the | |
!pip install --target=$nb_path catboost | |
#load the module in a new notebook | |
import sys | |
sys.path.append('/content/gdrive/My Drive/Colab Notebooks') | |
#Import the module | |
import catboost |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment