In this article, we will discuss how to install Eclipse and set up it for Python development in Ubuntu.
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.
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 –
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 –
Run the following command to start eclipse installer –
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.
You have successfully set up your Eclipse IDE for Python development. Now if you have a query then write us in the comments below.