I was extremely excited when Google announced their plans to support Linux apps on ChromeOS. I immediateley updated my Pixelbook and started tinkering around. To my surprise, thanks to the modern magic of conda, getting my data science workflow up-and-running was fairly painless. This post will guide you through the process of setting up Jupyter, Python, and (optionally) R to run in the Linux container on your Chromebook.

I will be using conda in this tutorial, which is an environment manager that is a bit more comprehensive than pip. You can even install RStudio and other development tools quite easily with conda. I don’t have time to do a full explainer here, but make sure you’re familiar with the basics before proceeding: conda documentation.


While it turns out you can do data science on a Chromebook, the question remains as to whether you should. I bought my Pixelbook hoping it would be a professional-grade device with superb reliability. Unfortunately, I’ve had many issues with bluetooth peripherals, external monitors, and WiFi connectivity. I’ve had to powerwash my Pixelbook twice in the last 6 months due to hardware issues. Indeed, the fact that I’ve had to setup my conda environment so many times is a reason I wanted to write this post in the first place!

If you are a diligent about backing everything up, you never have anything to worry about (except lost time); but given how much of a pain it is to restore my entire development workflow everytime I have to powerwash, if I were to buy a new computer for the purposes of doing data science, it would probably wouldn’t be a Chromebook.

<end opinion>

All that being said, Chromebooks are great machines (at relatively low prices) for personal, educational, and enterprise use. Whatever your reasons are for having a Chromebook, this post will help you get a Python-based data science workflow (using Jupyter) up and running. (Update: I’ve had people tell me they’ve been able to get Conda/Python/Jupyter running on machines with a humble 2GB of RAM and 16GB storage. So these instructions should work for almost any Chromebook on the market.)

1. Enable Linux Apps

Go to your Chromebook’s system settings and scroll down to the bottom. You should see an option to enable Linux Apps (this shouldn’t matter what OS channel you’re on, so long as you have at least Chrome ~71):

Follow the prompts; at the end, your computer should automatically launch a new “Terminal” app, which you will now see in your app drawer (I always pin it to the dock right away).

2. Download Miniconda

Using your browser, go to conda’s website at the following link and select which version of Python you want to go with your conda distribution by default: https://conda.io/miniconda.html. Since Python 2 is officially being sunset at the point, I recommend you choose the most up-to-date version of Python 3 for Linux 64-bit systems (for me, this is Python 3.7).

Important! Once you’ve downloaded the installer, use the ChromeOS File Explorer to move the file (usually something like Miniconda3-latest-Linux-x86_64) into the “Linux Files” section of your device’s storage.

3. Install Miniconda

Open the Terminal and navigate (using cd) to where you placed the Miniconda installer. Once there, run the following command to install conda on your machine:

username@penguin:~$ sudo bash Miniconda3-latest-Linux-x86_64.sh

You’ll be prompted to read through the license:

Just keep pressing enter until you are required to type yes:

Important! Different people will have different preferences about where exactly to install conda on their device; I’ve taken my cues from a couple of StackOverflow posts (here and here) on this topic, but know that this is by no means canonical.

When prompted to choose an installation location, I select /opt/miniconda3, as shown below:

Type yes when prompted to initialize Miniconda3 in your /root/.bashrc folder.

Once conda is installed, you’ll also want to set the right permissions for the folder so conda can add/remove packages (make sure you replace username in the snippet below; also replace /opt/miniconda3 with your install location if you specified a different folder):

username@penguin:~$ sudo chown -R username /opt/miniconda3

That should do it for your conda installation. Next, we just need to install Jupyter and you’ll be crunching numbers in no time.

4. Setup a conda environment & install Jupyter

To get conda running you’ll want to enter into the base environment by executing source /opt/miniconda3/bin/activate. Also, not to get too far into conda-ception, but I will usually add a sub-environment within my base conda which I find easier to manage. This can be done, along with activating the sub-environment and adding the conda-forge distribution channel, using the commands below:

(base) username@penguin:~$ conda create --name conda_env
(base) username@penguin:~$ conda activate conda_env
(conda_env) username@penguin:~$
(conda_env) username@penguin:~$ conda config --add channels conda-forge

To make sure these commands run automatically whenever you launch the Terminal, open your ~/.bashrc file in a text editor and add these three lines to the bottom:

# Get conda running in the base environment, activate sub-environment
source /opt/miniconda3/bin/activate
conda activate conda_env

The last line above (export XDG_RUNTIME_DIR="") allows the console to automatically open Chrome when you start Jupyter. Thanks to Daniel Pomales for the suggestion.

However you choose to set up your own conda environments, once you’re in your favorite environment, install Jupyter and generate a config file:

(conda_env) username@penguin:~$ conda install jupyter
(conda_env) username@penguin:~$ jupyter notebook --generate-config

This creates a config file at ~/.jupyter/jupyter_notebook_config.py, which allows you to set a password and customize other aspects of your Jupyter instance (see the Jupyter documentation for more info).

4.5 For R users: install the Jupyter R kernel

You can run R notebooks in Jupyter, and you can even run R in Python notebooks using rpy2 and the %%R magic (see here for more details).

(conda_env) username@penguin:~$ conda install r-irkernel
(conda_env) username@penguin:~$ conda install rpy2

Note you may also need to install some Linux packages using apt-get to get this working properly. Look at any error codes you get when trying to run R; they usually tell you which packages are missing.

5. Launch Jupyter — do data science!

Once you’ve accepted all the installation prompts for Jupyter and it’s various dependencies, launch jupyter directly from the terminal:

(conda_env) username@penguin:~$ jupyter notebook

If your browser fails to launch on its own, copy the token printed out in the console and append it to the following URL: http://penguin.linux.test:8888/tree?token=TOKEN_GOES_HERE

Launch a notebook and start coding! Keep in mind, with this setup, you’ll want to install new Python packages using conda (e.g., conda install numpy matplotlib pandas).