The PyDev plugin adds support for working with Python files to Eclipse. However, it is only auto-configured to work with a Python 2.x interpreter. Furthermore, Ubuntu installs Python 2.x by default and needs some manual work to work with Python 3.x.
To use Python 3.x for your Python files in Eclipse:
First install Python 3.x:
$ sudo apt install python3
This installs the Python 3.x interpreter as /usr/bin/python3. We will use this in Eclipse.
In Eclipse, open Preferences -> PyDev -> Interpreters -> Python Interpreter. Click Add and add /usr/bin/python3. The Libraries and other settings will be auto-discovered by PyDev.
That is it! When you create a new Python project, in its dialog remember to pick Grammar version as 3.0 and the Interpreter as Python3.
Tried with: Python 3.4.0, PyDev 3.9.0, Eclipse Luna 4.4.1 and Ubuntu 14.04
PyDev can be configured to analyze your code to check if it complies with the PEP8 guidelines. It generates errors and warnings if the code does not comply. For example, E501 complains if a line is longer than 80 characters.
Sometimes, you may want to ignore some specific errors or warnings of PEP8. To do this, go to Windows -> Preferences -> PyDev -> Editor -> Code analysis -> PEP8.py. Here add an --ignore string with the error and warning numbers you want ignored. For example, --ignore=E501. Restart Eclipse for changes to take effect.
Tried with: PyDev 3.9.0, Python 3.4.0, Eclipse Luna 4.4.1 and Ubuntu 14.04
Eclipse is developed as a modularized system with a central core platform and additional features and plugins that provide functionality required for a certain language (like Java or C++). These packaged versions of Eclipse that are put together for different languages is what is provided on its download page.
You may feel that the Eclipse packages available for Java or C++ (CDT) are extremely bloated with hundreds of features and plugins that you may never use. For example, Eclipse CDT includes hundreds of MyLyn features and cross-compiler support, none of which I may require right now. The beauty of Eclipse is that everything is a plugin, so you can actually build yourself a lean Eclipse that only includes what you want. This way you can build a minimal Eclipse that has only the features you want.
Step 1: Get the platform runtime binary
The core of Eclipse is provided for download as Eclipse Platform Runtime Binary. To get it, go to this page and click on the build number you want. It opens a new page, where you scroll down to the section named Platform Runtime Binary and download the package matching your system.
Unzip the zip file you downloaded and run the eclipse binary file. The IDE opens and it works.
Step 2: Add the plugins
Now add the plugins you want from Help -> Install New Software. For plugins provided by Eclipse, choose Luna from the dropdown. For external plugins, add their URL.
For creating a Eclipse C++ IDE of my own, I installed these plugins:
Luna -> Programming Languages -> C/C++ Development Tools
The easiest and recommended method to install PyDev is to use Install New Software as shown here. I found that this method was giving this error on Eclipse 4.4.1:
An error occurred while collecting items to be installed
session context was:(profile=epp.package.cpp, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=).
Unable to read repository at http://pydev.org/updates/plugins/com.python.pydev.debug_184.108.40.206411111611.jar.
Read timed out
Unable to read repository at http://pydev.org/updates/plugins/org.python.pydev.help_220.127.116.11411111611.jar.
Read timed out
Thankfully, PyDev plugin can be installed manually and that is what I ended up doing:
Eclipse is a strange beast. To search for a string, I was using the common Ctrl+F keyboard shortcut. This would pop up the familiar Find/Replace dialog. But soon, I was looking for a way to search through the entire project or workspace and could not find any way to do that using the Find/Replace dialog.
It turns out that there a larger, more complex Search feature in Eclipse! Why they would keep both Find and Search instead of combining them (like Visual Studio), that I cannot fathom. Ctrl+H is the default keyboard shortcut for this Search and indeed it shows up with custom searches for all the languages supported by Eclipse. (I use the PyDev Search, since I use Eclipse for Python code.)
The editor does not show the first matching search result (like in Find/Replace), but shows the Search results in a new Search window at the bottom. All in all, very odd business. But, at least I can now search through the entire project/workspace.