
Zip the package and unzip on Colab: While this works great for a single user, it becomes very difficult to maintain when working in a team. It is NOT recommended because it makes the notebook long and messy It makes versioning really difficult and almost any change will require a complete refactoring of the base code. Copy paste all the code into Colab: This only works for small projects (e.g. Previously I had 2 methods for using private code on Colab: This article details a reliable and quick way to install private packages using a package I’ve developed, colab-dev-tools. This is because pip no longer works as you need authentication, which is more difficult to achieve since GitHub’s decision to deprecate password authentication for Git Operations. That is, a package that you are developing on a private repository hosted on a versioning service (e.g. However, all this fails if you are working with private packages. All you need to do is to use pip install within the notebook. For most cases, this isn’t a particular issue and is only a minor inconvenience.
This means that you need to install all the packages you need every single time. However, one of its greatest shortcomings compared with Jupyter Notebooks is that you can’t install a custom kernel. !pip install colab-dev-tools import os from colabtools.utils import mount_drive, install_private_library drive_path = mount_drive() git_access_token_json_path = os.path.join(drive_path, PATH_TO_JSON) install_private_library(git_access_token_json_path, PROJECT_NAME)Ĭolab is a great tool for quickly testing Deep Learning models using the free GPU. I will try to keep this up-to-date, but in case it is not please visit the repository here.
Please note that the package is an Early Access Release and will likely have improvements in the future. json file has keys “username” → name of repository account holder, “access_token” → your GitHub access token. An elegant alternative to zipping projects