Install PyCharm on Ubuntu Linux with 3 Best Methods

Posted on

Install PyCharm on Ubuntu Linux with 3 Best Methods

Install PyCharm on Ubuntu Linux with 3 Best Methods

This guide aims to demonstrate How To Install PyCharm on Ubuntu Linux, including Ubuntu 24.04, Ubuntu 22.04, and Ubuntu 20.04. PyCharm is a powerful Integrated Development Environment (IDE) designed to streamline Python development. It offers a rich set of features, including code completion, debugging tools, project management capabilities, and version control integration, making it an indispensable asset for both novice and experienced Python developers.

You can now proceed to the guide steps below on the Orcacore website to install PyCharm on Ubuntu with various methods.

To illustrate the installation process, we will be using Ubuntu 24.04. Ensure you are logged into your server as a non-root user with sudo privileges before proceeding with the following steps to complete PyCharm Setup on Ubuntu Linux.

Method 1. PyCharm Setup with JetBrains PPA Repository

The first approach involves utilizing the JetBrains PPA (Personal Package Archive) repository. Start by updating your system’s package list using the following command:

sudo apt update

Next, install the necessary packages required for PyCharm setup on Ubuntu:

sudo apt install dirmngr ca-certificates software-properties-common apt-transport-https curl lsb-release -y

Now, import the JetBrains PPA GPG Key using the following curl command:

curl -s https://s3.eu-central-1.amazonaws.com/jetbrains-ppa/0xA6E8698A.pub.asc | gpg --dearmor | sudo tee /usr/share/keyrings/jetbrains-ppa-archive-keyring.gpg > /dev/null

Subsequently, add the JetBrains PPA repository to your APT repository list with the following command:

echo "deb [signed-by=/usr/share/keyrings/jetbrains-ppa-archive-keyring.gpg] http://jetbrains-ppa.s3-website.eu-central-1.amazonaws.com any main" | sudo tee /etc/apt/sources.list.d/jetbrains-ppa.list > /dev/null

Once completed, update the system again to reflect the changes:

sudo apt update

Install PyCharm with APT Command

Now, you can easily Install PyCharm on Ubuntu 24.04, Ubuntu 22.04, and Ubuntu 20.04 using the APT command. You have the option to choose between PyCharm Community, Education, or Professional editions. The PyCharm Community edition is the free version and can be installed with the following command:

sudo apt install pycharm-community -y
Install PyCharm with APT command

If you intend to use the paid editions, you can install them with the following commands:

# sudo apt install pycharm-education -y
# sudo apt install pycharm-professional -y

Update PyCharm with APT command

To update your PyCharm packages using APT, you can simply run the system update and upgrade commands:

# sudo apt update
# sudo apt upgrade -y

This method provides a straightforward way to complete your PyCharm setup on Ubuntu Linux. If you’re looking for alternative installation methods, proceed to the next steps to use Snapd and Flatpak.

Method 2. PyCharm Setup with Snapd

This method leverages Snap packages to install PyCharm editions on your Ubuntu system. Snapd is typically pre-installed and enabled in Ubuntu 24.04. However, for Ubuntu 22.04 and Ubuntu 20.04, you’ll need to install and enable it using the following commands:

# sudo apt install snapd -y
# sudo systemctl enable snapd --now
# sudo ln -s /var/lib/snapd/snap /snap
# sudo snap install core

Install PyCharm with Snap Command

Now you can easily use the following command to install PyCharm community edition with snap command on Ubuntu Linux:

sudo snap install pycharm-community --classic
Install PyCharm with Snap Command

For Professional and Education editions, you can use the commands below:

# sudo snap install pycharm-professional --classic
# sudo snap install pycharm-educational --classic

Note: Applications installed by Snap command may not appear on your desktop until the session is restarted.

Update PyCharm with Snap Command

You can easily update your PyCharm packages with Snap using the command below:

sudo snap refresh

Method 3. PyCharm Setup with Flatpak

Alternatively, you can use Flatpak, which is similar to Snapd, to install PyCharm packages.

First, you must install Flatpak and enable FlatHub on Ubuntu Linux with the commands below:

# sudo apt install flatpak -y
# sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

Install PyCharm with Flatpak Command

Now you can easily install PyCharm community edition by using the following Flatpak command:

sudo flatpak install flathub com.jetbrains.PyCharm-Community -y
Install PyCharm with Flatpak Command

You can also install PyCharm Professional edition with the command below:

sudo flatpak install flathub com.jetbrains.PyCharm-Professional -y

At the current time, Flatpak doesn’t support the Educational edition for PyCharm.

Note: Applications installed by Flatpak may not appear on your desktop until the session is restarted.

Update PyCharm with Flatpak Command

You can easily update your PyCharm packages with Flatpak using the command below:

sudo flatpak update

How To Launch and Access PyCharm on Ubuntu Linux?

At this point, you can easily launch PyCharm using your system’s graphical user interface. From your Activities search for PyCharm, and click on the app to access your application.

Launch and Access PyCharm on Ubuntu Linux
Access PyCharm on Ubuntu

You can also launch your PyCharm app from the command line interface. For the different setup methods you can use the following commands:

For APT Command:

# sudo pycharm-community
# sudo pycharm-professional
# sudo pycharm-education

For Snap Command:

# sudo snap run pycharm-community
# sudo snap run pycharm-professional
# sudo snap run pycharm-educational

For Flatpak Command:

# sudo flatpak run com.jetbrains.PyCharm-Community
# sudo flatpak run com.jetbrains.PyCharm-Professional

Uninstall and Remove PyCharm From Ubuntu Linux

If you no longer want to use PyCharm on your system, you can easily uninstall and remove it with the commands below depending on your installation method:

Remove PyCharm with APT

In this method, you need to remove your APT PyCharm package with the command below:

# sudo apt remove pycharm-community
# sudo apt remove pycharm-professional
# sudo apt remove pycharm-education

Also, you can remove the repository and GPG key with these commands:

# sudo rm /etc/apt/sources.list.d/jetbrains-ppa.list
# sudo rm /usr/share/keyrings/jetbrains-ppa-archive-keyring.gpg

Remove PyCharm with Snap

To uninstall and remove Pycharm package with snap, you can use the command below:

# sudo snap remove pycharm-community
# sudo snap remove pycharm-professional
# sudo snap remove pycharm-educational

Remove PyCharm with Flatpak

To uninstall and remove Pycharm package with Flatpak, you can use the command below:

# sudo flatpak uninstall --delete-data com.jetbrains.PyCharm-Community
# sudo flatpak uninstall --delete-data com.jetbrains.PyCharm-Professional

Alternative Installation Methods for PyCharm on Ubuntu

While the methods outlined above (APT, Snap, and Flatpak) are common and generally reliable, alternative approaches exist for installing PyCharm on Ubuntu Linux. These methods might be useful in specific scenarios, such as when you need a very specific version or want more control over the installation process. Here are two such alternatives:

1. Manual Installation from JetBrains Website:

This method involves downloading the PyCharm archive directly from the JetBrains website and manually extracting and configuring it. This gives you the most control over the installation directory and allows you to easily manage multiple versions of PyCharm.

  • Download: Visit the JetBrains website (https://www.jetbrains.com/pycharm/download/) and download the appropriate tarball (.tar.gz) for Linux. Choose either the Professional or Community edition.

  • Extract: Extract the downloaded archive to a directory of your choice. A common location is /opt.

    sudo tar -xzf pycharm-community-*.tar.gz -C /opt/

    Replace pycharm-community-*.tar.gz with the actual filename you downloaded.

  • Run: Navigate to the bin directory within the extracted folder and execute the pycharm.sh script to launch PyCharm.

    /opt/pycharm-community-*/bin/pycharm.sh
  • Create Desktop Entry (Optional): For easier access, create a desktop entry file (.desktop file) in ~/.local/share/applications/. This will allow you to launch PyCharm from your application launcher.

    Create a file named jetbrains-pycharm-ce.desktop (or similar) with the following content:

    [Desktop Entry]
    Name=PyCharm Community Edition
    Comment=The Python IDE
    Exec=/opt/pycharm-community-*/bin/pycharm.sh
    Icon=/opt/pycharm-community-*/bin/pycharm.png
    Terminal=false
    Type=Application
    Categories=Development;IDE;

    Again, replace placeholders like /opt/pycharm-community-*/ with the actual path to your PyCharm installation directory. Make the file executable:

    chmod +x ~/.local/share/applications/jetbrains-pycharm-ce.desktop

This method avoids package managers entirely and allows you to run PyCharm directly from the extracted directory. It’s useful when you need to run a specific version that might not be available in the package repositories. This method is also a good option for PyCharm setup on Ubuntu when needing multiple versions of PyCharm installed.

2. Using Conda Environments:

If you are primarily working with Python environments managed by Conda (Anaconda or Miniconda), you can leverage Conda to install PyCharm and manage its dependencies. While Conda doesn’t directly "install" PyCharm, it can be used to create an isolated environment and then launch PyCharm from within that environment, ensuring consistent dependencies.

  • Create a Conda Environment (Optional): It’s generally good practice to create a dedicated Conda environment for your project.

    conda create -n my_pycharm_env python=3.9  # Or your preferred Python version
    conda activate my_pycharm_env
  • Install Project Dependencies: Install any project-specific Python packages you need within the Conda environment.

    conda install numpy pandas scikit-learn
  • Launch PyCharm: You can now launch PyCharm using any of the methods described above (APT, Snap, Flatpak, or Manual). When PyCharm starts, configure it to use the Conda environment you created as the project interpreter. This will ensure that PyCharm uses the correct Python version and has access to the project’s dependencies.

    To configure the interpreter:

    1. Open your project in PyCharm.
    2. Go to File -> Settings (or PyCharm -> Preferences on macOS).
    3. Navigate to Project -> Python Interpreter.
    4. Click the gear icon and select "Add Interpreter…".
    5. Choose "Conda Environment" -> "Existing environment".
    6. Browse to the location of your Conda environment (usually ~/anaconda3/envs/my_pycharm_env or ~/miniconda3/envs/my_pycharm_env).
    7. Select the python executable within the environment.

This approach doesn’t install PyCharm with Conda, but it ensures that PyCharm uses a well-defined and isolated environment for your project. This helps avoid dependency conflicts and ensures reproducibility. This alternative method to Install PyCharm on Ubuntu is more about setting up the project and development environment that uses PyCharm rather than the installation itself.

Conclusion

Installing PyCharm on Ubuntu Linux provides developers with a robust IDE for Python programming. It offers tools for coding, debugging, project management, and integration with version control systems, leading to faster and more efficient development. Whether you’re a beginner or an expert, PyCharm helps you write clean code and manage Python projects effectively. Understanding the variety of methods for installing and configuring PyCharm helps ensure you have the optimal setup for your development needs.

Hope you enjoy it. Please subscribe to us on Facebook, YouTube, and X.

Also, you may like to read the following articles:

Installing RabbitMQ Server on Ubuntu 24.04

Set up Samba File Share on Ubuntu 24.04

Set a Static IP Address on Ubuntu 24.04 Via GUI

Install Ubuntu 24.04 LTS Desktop

FAQs

Is PyCharm free to use on Ubuntu Linux?

Yes, PyCharm offers a free version called PyCharm Community Edition, which includes essential features for Python development.

Can I use PyCharm for web development?

Yes, PyCharm Professional Edition provides full support for web development, including frameworks like Django, Flask, and JavaScript, among others. The free Community Edition is focused mainly on Python development.

Can PyCharm be used for other programming languages besides Python?

PyCharm primarily focuses on Python, but the Professional Edition also supports other languages such as JavaScript, HTML, CSS, and SQL, making it useful for full-stack development.

Leave a Reply

Your email address will not be published. Required fields are marked *