The Raspberry Pi is often used as a programming learning device (and it was designed just for this). The default editors are fine for beginners, but if you’re doing serious code on your Raspberry Pi, you’ll probably look for a better alternative. Today, we’ll see how to install PyCharm on a Raspberry Pi.
PyCharm has a community version, available for free on their website. The download file for Linux is already compiled, so that the PyCharm IDE can be started directly by running pycharm.sh.
Running it once is fine, but the idea in this article is to go further. I’ll show you everything to get the most of it.
Install PyCharm on Raspberry Pi OS
If like me, you always mix the languages syntax, download my cheat sheet for Python here!
With Eclipse and Visual Studio, PyCharm is one of the most popular IDEs for programmers, especially in Python. Market share results vary too much to be considered – from 7% on the Top IDE index to 35% for JetBrains, the PyCharm editor ^^.
PyCharm is well-known in the industry, with all the best features we can expect from an IDE, that’s why we’ll learn how to install it on our Raspberry Pi.
Download the Community version
PyCharm has two versions available:
- A Professional Edition, where you need a license to use it (approximately $200 a year).
- A Community Edition, which is open-source and free to use
In this tutorial, we’ll try the Community Edition, but there is a free trial for the Professional if you are interested.
To download the files, you can go to this URL on the official website.
Extract the files
You should get a tar.gz file in your Downloads folder. You will need to extract all the files:
- Open the file manager (there is a shortcut in the top bar).
- Go to /home/pi/Downloads.
- Find the PyCharm archive and right-click it.
- Choose “Extract here” and wait a few seconds:
A new folder will be created containing all the files.
If you prefer the command line, you can also start a terminal and run:
tar -zxvf pycharm-community-A.B.C.tar.gzReplace A.B.C with the version number you downloaded (tip: use tab to auto-complete the file name).
Before doing anything else, we need to install Java. If you try to run it directly on a fresh Raspberry Pi OS installation, it won’t work.
I’ll show you how to do this in the GUI, but you can find the command line at the end of this section if you prefer:
- In the main menu, go to Preferences > Add/Remove Software.
- Type “openjdk” in the search engine on the left,
- Install the package named “openjdk-11-jdk”:
- If you are on the full version or have already installed Java apps, it may be installed already.
But on a fresh Raspberry Pi OS Desktop, it’s not.
And here is how to do the same thing with one command line:
sudo apt install openjdk-11-jdkThat’s it, we can now start PyCharm!
If you don’t understand what we are doing here, or need any more help, I have an entire tutorial on how to install Java on a Raspberry Pi.
As there is no installation wizard for PyCharm, you won’t find it in the main menu.
We’ll get back to this later, but for now, you can try running it from the Downloads folder:
- Once again, open the File Manager and go to /home/pi/Downloads.
- Go into the newly extracted folder (pycharm-community-A.B.C).
- The executable is in the bin subfolder.
- Double-click on “pycharm.sh”.
- Choose “Execute” in the popup windows.
That’s it, PyCharm should start directly. You need to accept the use agreement, and the interface will start.
From there you can use it as you are used to, I suppose.
The goal of this tutorial isn’t to show you how to use PyCharm. If it is your first time using it, you can easily find some help from the Internet.
Improve your PyCharm installation
Grab your free PDF file with all the commands you need to know on Raspberry Pi!
If you are used to my articles, you know that I always try to add a few bonus tips. After installing PyCharm, there are at least two things you can do to improve your experience.
Move the files in a safer location
I don’t know for you, but in my case, I consider the Downloads folder a temporary folder. You rarely need the files in it more than once.
As soon as I have too many files in it, I delete everything or at least move the files into a subfolder to make sure I don’t need them.
Anyway, it isn’t a good practice to keep your applications in the Downloads folder. If there isn’t an installation wizard, it’s recommended to move them to another folder (/opt for example). That’s exactly what we’ll do:
- Close PyCharm if it’s still running.
- Open a terminal.
- Run the following command:
sudo mv /home/pi/Dowloads/pycharm-community-A.B.C /opt/
Don’t forget to replace A.B.C with the version number you have.
We have to use a terminal because the default user on Raspberry Pi (pi) doesn’t have the right to write in the /opt folder.
You can now start PyCharm from the /opt folder instead of /home/pi/Downloads.
But that’s not very convenient, which is why I’ll show you how to create a shortcut in the main menu.
Create a shortcut for PyCharm in the main menu
If there isn’t an installation wizard, we have to create the shortcut manually:
- Open the main menu.
- Go to Preferences > Main Menu Editor.
- Click on “Programming” on the left.
- Then “New Item” on the right.
- A form shows up, fill it like this:
- Name: PyCharm
- Command: /opt/pycharm-community-A.B.C/bin/pycharm.sh
- Comment: Not mandatory, you can skip this field.
- You can also click on the picture on the left and add an icon.
There is a PNG file available in the PyCharm’s bin directory.
- Click on “OK” to confirm.
The new entry should now be available in the main menu, under Programming:
Also, if you have any doubt about this guide to install PyCharm on a Raspberry Pi, I have a step-by-step video that you can find here:
This can be useful to watch while you install PyCharm on your Raspberry Pi, just to make sure you don’t miss anything. Also, there are 3 PyCharm bonus tips that I love and share with you.
If you have any comment, suggestion or just want to chat with us about this tutorial,
you can post your messages in the community on Patreon. See you there!
Alternatives to PyCharm on Raspberry Pi
As I told you at the beginning, PyCharm is not the only option to code on a Raspberry Pi.
Some basic editors like Geany and Thonny are pre-installed.
Visual Studio is now available in the recommended software tool, and many others can be installed on a Raspberry Pi.
If you are still not sure if PyCharm is the best solution for you, I highly recommend reading my article about the best editors available on Raspberry Pi. You’ll necessarily find the top solution for your specific needs.