Install Python 3.8 kernel in Google Colaboratory

I have found how to run Python 3.8 notebook on Colab. install Anaconda3 add (fake) google.colab library start jupyterlab access it with ngrok Here’s the code # install Anaconda3 !wget -qO ac.sh https://repo.anaconda.com/archive/Anaconda3-2020.07-Linux-x86_64.sh !bash ./ac.sh -b # a fake google.colab library !ln -s /usr/local/lib/python3.7/dist-packages/google \ /root/anaconda3/lib/python3.8/site-packages/google # start jupyterlab, which now has Python3 = 3.8 … Read more

Colaboratory: Can I access to my Google drive folder and file?

Here’s an example of using a FUSE Drive interface to access your Drive files like local files: https://colab.research.google.com/notebook#fileId=1srw_HFWQ2SMgmWIawucXfusGzrj1_U0q In short: # Load the Drive helper and mount from google.colab import drive drive.mount(‘/content/drive’) After executing the code above, your Drive files will be present in /content/drive/My Drive. I’m guessing you also found the bundled example I/O … Read more

Importing .py files in Google Colab

You can save it first, then import it. from google.colab import files src = list(files.upload().values())[0] open(‘mylib.py’,’wb’).write(src) import mylib Update (nov 2018): Now you can upload easily by click at [>] to open the left pane choose file tab click [upload] and choose your [mylib.py] import mylib Update (oct 2019): If you don’t want to upload … Read more

How do I install a library permanently in Colab?

Yes. You can install the library in Google Drive. Then add the path to sys.path. import os, sys from google.colab import drive drive.mount(‘/content/drive’) nb_path=”/content/notebooks” os.symlink(‘/content/drive/My Drive/Colab Notebooks’, nb_path) sys.path.insert(0,nb_path) Then you can install a library, for example, jdc, and specify the target. !pip install –target=$nb_path jdc Later, when you run the notebook again, you can … Read more

Import data into Google Colaboratory

An official example notebook demonstrating local file upload/download and integration with Drive and sheets is available here: https://colab.research.google.com/notebooks/io.ipynb The simplest way to share files is to mount your Google Drive. To do this, run the following in a code cell: from google.colab import drive drive.mount(‘/content/drive’) It will ask you to visit a link to ALLOW … Read more