Eclipse is a cross-platform integrated development environment mostly used for the development of Java projects. We can enhance its functionality using plugins to support some other programming languages like PHP, C++, Python, JavaScript, etc.
In this article, we will discuss how to install Eclipse and set up it for Python development in Ubuntu.
Prerequisites
To follow this guide you should have the following –
- Access to a user account with sudo privileges
- You should have the java runtime environment installed on your system
Installing Eclipse for Python development in Ubuntu
To set up your Eclipse IDE for Python development you need to install a plugin called PyDev. It has features like Python Linter, debugging, autocompletion, refactoring support, Django support, etc.
So first install and set up the Eclipse IDE on your Ubuntu system and then install PyDev on it.
Installing Java
Eclipse is a java based IDE it requires the java runtime environment (JRE) to be installed on your system.
sudo apt install default-jdk
Press y and then enter when it asks you for confirmation.
Installing Eclipse IDE
Go to the download page on its official website and download the Eclipse for Linux 64 bit.
OR use the following command to download it –
wget https://mirrors.neusoft.edu.cn/eclipse/oomph/epp/2021-09/R/eclipse-inst-jre-linux64.tar.gz
Once the download is completed, use the following command to extract the downloaded package –
sudo tar xfz Downloads/eclipse-inst-jre-linux64.tar.gz -C /opt/
Now use the following to move to the extracted directory –
cd /opt/eclipse-installer/
Run the following command to start eclipse installer –
./eclipse-inst
This will launch the installer click on eclipse for java this will display the given window here select the correct installation folder and click on INSTALL.
Accept the user license agreement this will download the required packages.
Once the download and installation process is completed click on Launch to start the application.
Installing PyDev plugin in Eclipse
When the application opens go to Help > Eclipse Marketplace and find the PyDev plugin as you can see in the image below.
Now click on Install.
Next, confirm installation by clicking on Confirm.
Next review licenses, select I accept the terms of the licenses agreements, and click on Finish.
How to use Eclipse for Python development
To make Eclipse use the PyDev plugin go to Window> Perspective> Open Perspective> Other select PyDev and then click on Open.
Next, go to File> New> PyDev Project this will display the given window. Enter the project name and click on the Please configure interpreter before proceeding and then on Config first in PATH.
This will automatically configure the interpreter. Finally, click on Finish to create the project.
Now you can add python files and folders to write your code.
Conclusion
You have successfully set up your Eclipse IDE for Python development. Now if you have a query then write us in the comments below.