[QGIS-Developer] Eclipse config for QGIS API

Lauri Kajan lauri.kajan at gmail.com
Mon Jan 22 12:02:44 PST 2018


2018-01-20 15:29 GMT+02:00 Anita Graser <anitagraser at gmx.at>:
>
> ​If I keep this call to o4w_env.bat in the starter, Eclipse fails to
> start.
>
Any error message?

​Is it possible to configure Eclipse to have both a Python 2 and Python 3
> interpreter?
>
Yes it should be possible but you need two different starter bat files and
you can't use those at the same time.

When working with QGIS 2.18 plugins my starter bat look like this:
--- qgis2-eclipse.bat
@echo off
set OSGEO4W_ROOT=C:\OSGeo4W64
call "%OSGEO4W_ROOT%\bin\o4w_env.bat"

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

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

And for QGIS3 plugins:
--- qgis3-eclipse.bat
@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;C:\
Users\lauri\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins
set PATH=%OSGEO4W_ROOT%\apps\qgis-dev\bin;%PATH%

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

When adding the interpreters. Try to add the same version python
interpreter that was defined in the starter bat that was used to start
eclipse.
Your python 3 interpreter error message looks like that you tried to add it
when python 2.7 environment was active.



I don't know if it makes any difference but I always have used a bare
Eclipse Platform Runtime Binary (that is without any plugins or development
tools) and then added just Pydev. You also need to install JRE separately.

2018-01-20 15:29 GMT+02:00 Anita Graser <anitagraser at gmx.at>:

> My Eclipse setup for Python 2 is working but trying to add a Python 3
> interpreter there are new issues.
>
> On Mon, Jan 15, 2018 at 10:18 PM, Lauri Kajan <lauri.kajan at gmail.com>
> wrote:
>>
>> My eclipse starter bat look like this:
>> ----------
>> @echo off
>> set OSGEO4W_ROOT=C:\OSGeo4W64
>> call "%OSGEO4W_ROOT%\bin\o4w_env.bat"
>>
>
> ​If I keep this call to o4w_env.bat in the starter, Eclipse fails to
> start.
>
> I have always used python.exe found from C:\OSGeo4W64\apps\Python36\python.exe
>> as a pydev interpreter. Don't know if that matters.
>>
>
> When trying to add this interpreter in PyDev, I run into the following
> issue:
>
> No output was in the standard output when
> trying to create the interpreter info for: C:\OSGeo4W64\apps\Python36\
> python.exe
> The error output contains:>><<
>> ​Is it possible to configure Eclipse to have both a Python 2 and Python 3
> interpreter?
>
> Regards,
> Anita​
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20180122/7f249194/attachment.html>


More information about the QGIS-Developer mailing list