[QGIS-Developer] Eclipse config for QGIS API

Lauri Kajan lauri.kajan at gmail.com
Mon Jan 15 13:18:28 PST 2018


Hi Anita,

My eclipse starter bat look like this:
----------
@echo off
set OSGEO4W_ROOT=C:\OSGeo4W64
call "%OSGEO4W_ROOT%\bin\o4w_env.bat"
call "%OSGEO4W_ROOT%\bin\py3_env.bat"
call "%OSGEO4W_ROOT%\bin\qt5_env.bat"

set
PYTHONPATH=%PYTHONPATH%;%OSGEO4W_ROOT%\apps\qgis-dev\python;%OSGEO4W_ROOT%\apps\qgis-dev\python\plugins
set PATH=%OSGEO4W_ROOT%\apps\qgis-dev\bin;%PATH%

start "eclipse" C:\eclipse\eclipse.exe
-----------

And then I have added 'qgis' and 'PyQt5' to the Forced Builtins in eclipse
interpreter settings.
Of course if you are developing on 2.18 you need to remove from the bat
py3_env.bat and qt5_env.bat calls and add to the forcedbuiltins PyQt4
instead PyQt5

I have always used python.exe found
from C:\OSGeo4W64\apps\Python36\python.exe as a pydev interpreter. Don't
know if that matters.


Let's hope this helps!


-Lauri



2018-01-15 22:23 GMT+02:00 Clemens Raffler <clemens.raffler at gmail.com>:

> Hi Anita,
>
> after some headaches I managed to enable full code-completion in
> eclipse/pydev for pyqgis and PyQt5 for the current development version. I
> hope sharing my setup (similar to yours on OSGeo4W64) with you may help:
>
> -) First I configured my PYTHONHOME and PYTHONPATH environment variables
> in the Windows configuration:
>
> PYTHONHOME="C:\OSGeo4W64\apps\Python36\python.exe"
> PYTHONPATH="C:\OSGeo4W64\bin;C:\OSGe‌​o4W64\apps\qgis\‌​bin;%Path%"
>
> -) In the windows Path variable I entered following paths to all the libs:
>
> C:\OSGeo4W64\bin
> C:\OSGeo4W64\apps\Qt5\bin
> C:\OSGeo4W64\apps\qgis-dev\bin
> C:\OSGeo4W64\apps\qgis-dev\python
> C:\OSGeo4W64\apps\‌​qgis-dev\python\plug‌​ins
> C:\OSGeo4W64\apps\‌​qgis-dev\python\plug‌​ins\processing
>
> With this system-side setup you can start eclipse even without .bat file
> and finish the configuration with the following steps:
> -) Window>Preferences>Pydev>Interpreters>Python Interpreter
> -) Add your Python interpreter at C:\OSGeo4W64\apps\Python36\python.exe
> -) Configure the interpreters environment variables at the tab
> "Environment" and there again set (yet) another variable named PATH with
> the following values:
>
> PATH="C:\OSGeo4W64\bin;C:\OSGeo4W64\apps\qgis-dev\bin;C:\
> OSGeo4W64\apps\Qt5\bin;C:\OSGeo4W64\apps\qgis-dev\python\
> plugins\processing"
>
> -) Then enter two new "Forced Builtins" under the respective tab. Enter
> "qgis" and "PyQt5".
> -) Finish by applying all your changes.
>
> The code-completion should now work - maybe reload eclipse by using File >
> Restart (sometimes simple closing doesn't help...).
> I hope there are no typos in this guide, however I wish you good luck with
> the setup!
>
> Regards,
> Clemens
>
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20180115/a4e64458/attachment.html>


More information about the QGIS-Developer mailing list