Install NumPy and Matplotlib on Chromebook/Linux(Beta)

Linux(Beta) on Chromebook is really cool. You easily and officially turned it by following a very simple step. Apparently there are also ways to enable audio capture and GPU acceleration as well.

I’m playing with an AAarch64(ARM64) Chromebook, Lenovo N23 Yoga, with MTK8173 chipset. It turns out to be an interesting experience, when it comes to do some simple Python development.

Step 1 – Enable Linux (beta)

Follow the instructions at this page.

Step 2 – Install debian packages

The Linux environment seems to be a container-type environment, running Debian Linux. Python3 is already installed.

sudo apt update
sudo apt install python3-pip pkg-config libpng-dev libfreetype6-dev python3-tk

Step 3 – Install PIP3 packages

pip3 install cython
pip3 install numpy
pip3 install matplotlib

Step 4 – Try it out

Create the following Python file

import numpy
import matplotlib.pyplot as plt

x = numpy.random.normal(5.0, 1.0, 100000)

plt.hist(x, 100)

Then run it by typing “python3”. If everything goes well, you should see some picture like the following: