When Chromebooks first landed in the market, users primarily used them to execute tasks via the Google Chrome browser, with most of the apps and data residing on the cloud. The local data is relatively less than most of these devices, with only an SSD with a few GB of storage.
With a few more advancements, the Chrome OS (the Primary OS for Chromebooks) could now support Android applications and Linux software. That enhanced its abilities, and it could perform more tasks other than those that require remote computing.
If you are reading this post, you are probably a developer or a user trying to run an application that requires Python – an interpreted, high-level, and general-purpose programming language. Lucky for you, we will show you the different methods you can use to run Python on your device, considering whether your Chromebook includes support for Linux and Androids apps or not.
Running Python on a Chromebook
Let’s look at some of the methods you can use to have Python running on your Chromebook.
- Enabling Linux and installing Python (For Chromebooks that support Linux applications).
- Use a Chrome Extension – Python Shell.
- Use the Skulpt Interpreter Chrome app.
Let’s look at each of these methods.
1. Enable Linux and install/launch Python
Most of the latest releases of Chromebooks support Linux applications. However, that does not come enabled by default. Our post on How to install and configure Linux Apps on Chrome OS will give you a clear guide on how to enable Linux on Chromebooks. That will give you a Terminal window from where you can start executing Linux commands.
To understand how we will run Python with this method, we first need to know how Linux apps run on Chrome OS.
By enabling Linux from the Settings window, you are simply running a Debian Virtual Machine on the Chrome OS. Debian is a popular Linux distribution that comes with over 59,000 packages. Luckily, Python is one of them.
To get started, run one of the commands below on the Terminal and see whether Python is installed.
python3 --version or python --version
If you get an output like that on the image below, you are good to go. However, if you get an error like, “-bash: python: command not found,” you need to install Python.
To install Python3.8, execute the commands below:
sudo apt update sudo apt install software-properties-common sudo add-apt-repository ppa:deadsnakes/ppa sudo apt install python3.8 python3 --version
Once you confirm that Python is installed successfully, you can start writing your Programs by executing the Python shell or via file. With the Python shell, execute the command
python3. You will get a shell where you can start writing your Python codes.
a = "Hello World" print(a)
If you have written your code in a file, save it with a
.py extension in the Linux Files directory.
2. Using a Chrome Extension – Python Shell.
Once you have the Python Shell extension installed, proceed to launch it from the extensions manager. You will see a small window pop-up on your browser where you can execute your Python code.
This method is efficient as it can be used in all Chromebook releases. Whether they support Linux apps or not.
3. Use the Skulpt Interpreter
Another way you can run Python on your Chromebook is by using the Skulpt Interpreter Chrome app. Skulpt is an entirely in-browser implementation of Python. When you run the code, it is fully executed on your browser. Use the following link to download Skulpt Interpreter.
Once installed, proceed to launch the Skulpt Interpreter from the applications menu.
That’s it! Those are three ways you can use to run Python on your Chromebook.
Which way to go?
If you are serious about Python programming with your Chromebook, I recommend you go the Linux way. That way, you can also use external libraries that might not work very well with Python extensions. Which method did you find fascinating? Or how do you run Python on your Chromebook? Please feel free to share with our readers in the comments below.