How to Install Python in Eclipse
Eclipse is an integrated development environment (IDE) that provides convenient and powerful code editing and debugging tools.
Eclipse is mostly used for java development. Eclipse requires the PyDev extension to properly develop Python code.
You can download Eclipse from here, if you don’t have it installed on your system.
In Eclipse, we can install the extensions from within the application.
- From the menu system, select
Help >> Software Updates >> Find and Install...
Search for new features to install
- Click the “New Remote Site…” button and enter the following web address:
- Select the new site by checking its box, and click
- Click to install PyDev and follow the directions, then wait for the new software to be downloaded and installed.
- Open the Preferences window within Eclipse and select
Pydev >> Interpreter - Python"
- In the top of the preferences pane, click
New...and locate your installation of Python (python.exe).
PyDev installation has completed, now let’s create a new Python Project.
Eclipse organizes all of your code into projects.
File >> New >> Project...
Pydev >> Pydev Project
- Give the project a name, and press
Running Python from within Eclipse
Now we are ready to create a new python file and run it from within Eclipse. Right-click on your project and create a new blank file. Make sure your file ends in .py, and Eclipse will recognize it as Python code.
Type in some Python code, then right-click on the Python file you’ve created and select
Run As >> Python run . You should see the output of your Python code in the console at the bottom of the Eclipse window.
Now that you’ve run the code once, you can press the green
Run arrow at the top of the Eclipse window to run it again.