How to run Julia on Google Colab

When speed meets power !!!

Image for post
Image for post

From here, you have 2 options

  • Utilize Colab’s GPU

Just using CPU

Create a file with .ipynb extension and paste the following JSON in it

This article was written in June of 2020, please check for the newer version, if you can find it.

{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "Julia on Colab.ipynb",
"version": "0.3.2",
"provenance": []
},
"kernelspec": {
"name": "julia-1.2",
"display_name": "Julia 1.2"
},
"accelerator": "GPU"
},
"cells": [
{
"metadata": {
"id": "oMSuTc3pDlHv",
"colab_type": "code",
"colab": {}
},
"cell_type": "code",
"source": [
""
],
"execution_count": 0,
"outputs": []
}
]
}
  • Open Google Colab and upload this notebook (don’t change any notebook setting now, even if google colab prompts you to do so)

Copy-paste the following code in a cell and run it using Shift+Enter :

!curl -sSL "https://julialang-s3.julialang.org/bin/linux/x64/1.2/julia-1.2.0-linux-x86_64.tar.gz" -o julia.tar.gz!tar -xzf julia.tar.gz -C /usr --strip-components 1!rm -rf julia.tar.gz*!julia -e 'using Pkg; pkg"add IJulia; precompile"'!echo "DONE"

Again, this is using Julia version 1.2, to use the newer version, just replace the URL of curl with the version you desire

That’s is, you can run your Julia code on colab with ease

Utilize Colab’s GPU

if you want the juicy graphics horsepower, please refer to this forum post :

CONGRATS !!!

I hope you were successful :

Follow me on

Github: https://github.com/dev117uday

Linkedin: https://www.linkedin.com/in/uday-yadav-4995a818a/

Sophomore && CSE Undergrad

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store