I am new to QGIS and coding for QGIS, but I have experience with C++ and Qt. I am reading the book "Python Programming CookBook" to learn how to develop a plugin to QGIS, however I am facing some problems with the setup of IDE eclipse as external editor to QGIS. I installed the plugin "script runner" on QGIS to run the eclipse editor. Until here it's working fine.
In the following steps from "QGIS Python Programming CookBook" it says to add pyqgis interpreter to eclipse as below:
Steps from the book:
2.From the Window menu, select Preferences. On OS X, you must click on the Eclipse menu to find the preferences menu.
3.In the pane on the left-hand side of the Preferences window, click on the plus sign next to PyDev.
4.From the list of PyDev preferences, select Interpreter Python.
5.In the pane labelled Python Interpreters, click on the New button.
6.In the Select interpreter dialog, name the interpreter PyQGIS.
7.Browse to the location of the QGIS Python interpreter called python.exe within the bin folder of the QGIS program folder.
- When you click on the OK button, Eclipse will attempt to automatically add every Python library it finds to the Python path for this interpreter configuration. We need to control which libraries are added to prevent conflicts. Click on the Deselect All button and then click on OK:
When I click OK button it gives this error:
"See error log for details. No output was in the standard output when trying to create the interpreter info for: C:\Program Files\QGIS Essen\bin\python.exe The error output contains:>>ImportError: No module named site <<"
I think that the objective of this feature is to facilitate the coding of python into QGIS program, because the author says:
"The Eclipse IDE with the PyDev plugin is cross-platform, has advanced debugging tools, and is free. This tool makes an excellent PyQGIS IDE. Eclipse allows you to have multiple Python interpreters configured for different Python environments. When you install PyDev, it automatically finds the installed system Python installations. On Windows, you must also add the Python interpreter installed with PyQGIS. On all platforms, you must tell PyDev where the PyQGIS libraries are"
That part of bold is exactly what I a having being try to do.