Re: [QGIS-Developer] Eclipse config for QGIS API

2018-01-27 Thread Anita Graser
Thank you for your help Lauri!

Motivated by your recommendations and the post
https://gisforthought.com/updating-a-plugin-from-qgis-2-to-qgis-3/, I
figured it out:

I copied python-qgis-dev.bat and appended

set
PATH=%PATH%;C:\OSGeo4W64\apps\qgis-rel-dev;C:\OSGeo4W64\apps\qgis-rel-dev\bin;C:\OSGeo4W64\bin;C:\OSGeo4W64\apps\Python27\DLLs;C:\Program
Files\Java\jre1.8.0_91\bin
C:\Users\anita\ide-latest-released\eclipse\eclipse.exe

This way, eclipse starts and I can add the OSGeo4W Python3 interpreter.

Regards,
Anita
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] Eclipse config for QGIS API

2018-01-22 Thread Lauri Kajan
2018-01-20 15:29 GMT+02:00 Anita Graser :
>
> ​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 :

> 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 
> 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​
>
>
>
>
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] Eclipse config for QGIS API

2018-01-20 Thread Anita Graser
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  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​
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] Eclipse config for QGIS API

2018-01-16 Thread Anita Graser
Thank you all for offering your help!

I'm a bit mystified, but between trying all kinds of different things, I
now got it working.

Let's see how long it lasts :)

Regards,
Anita

​

On Mon, Jan 15, 2018 at 10:18 PM, Lauri Kajan  wrote:

> 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 :
>
>> 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:\OSG
>> eo4W64\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@lists.osgeo.org
>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>
>
>
> ___
> QGIS-Developer mailing list
> QGIS-Developer@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] Eclipse config for QGIS API

2018-01-15 Thread Lauri Kajan
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 :

> 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@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] Eclipse config for QGIS API

2018-01-15 Thread Clemens Raffler

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@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] Eclipse config for QGIS API

2018-01-15 Thread Anita Graser
Hi Sylvain,

Thank you for your tipps! I've added a PATH to the Environment. Had to
adjust for an OSGeo4W install:

https://www.dropbox.com/s/57ywuz4mt65gy1e/Screenshot%202018-01-15%2019.46.55.png?dl=0

Also, my eclipse.bat looks like this:

call "C:\OSGeo4W64\bin\o4w_env.bat"
set
PATH=%PATH%;C:\OSGeo4W64\apps\qgis-rel-dev;C:\OSGeo4W64\apps\qgis-rel-dev\bin;C:\OSGeo4W64\bin;C:\OSGeo4W64\apps\Python27\DLLs;C:\Program
Files\Java\jre1.8.0_91\bin
C:\Users\anita\ide-latest-released\eclipse\eclipse.exe

Unfortunately, imports are still unresolved.

Regards,
Anita




On Mon, Jan 15, 2018 at 9:00 AM, PIERRE Sylvain 
wrote:

> Hi Anita,
>
> I’m using Eclipse with QGIS API without problems (with Essen old release)
> . Import works.
>
> Did you set a PATH variable in the Environment tab? (for me value is:
> C:\Program Files\QGIS Essen;C:\Program Files\QGIS Essen\bin;C:\Program
> Files\QGIS Essen\apps\qgis-ltr\bin;C:\Program Files\QGIS
> Essen\apps\python27\DLLs)
>
>
>
> Sylvain
>
>
>
>
>
> *De :* QGIS-Developer [mailto:qgis-developer-boun...@lists.osgeo.org] *De
> la part de* Anita Graser
> *Envoyé :* dimanche 14 janvier 2018 15:07
> *À :* qgis-dev
> *Objet :* [QGIS-Developer] Eclipse config for QGIS API
>
>
>
> Hi,
>
>
>
> I've been following https://docs.qgis.org/testing/
> en/docs/pyqgis_developer_cookbook/ide_debugging.html to set up Eclipse
> including "Making eclipse understand the [QGIS] API"
>
>
>
> When I import from qgis.core:
>
>
>
> from qgis.core import qgsfunction, QgsExpression
>
>
>
> qgsfunction is recognized but QgsExpression is not:
>
>
>
> https://www.dropbox.com/s/zmbzllwu2egijbq/Screenshot%
> 202018-01-14%2014.52.52.png?dl=0
>
>
>
> My Python interpreter is set up as shown here
>
>
>
> https://www.dropbox.com/s/ztnr4e6zbjkk35z/Screenshot%
> 202018-01-14%2014.54.08.png?dl=0
>
>
>
> Am I missing something to get full PyQGIS code completion?
>
>
>
> Regards,
>
> Anita
>
>
>
>
>
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] Eclipse config for QGIS API

2018-01-15 Thread PIERRE Sylvain
Hi Anita,
I’m using Eclipse with QGIS API without problems (with Essen old release) . 
Import works.
Did you set a PATH variable in the Environment tab? (for me value is: 
C:\Program Files\QGIS Essen;C:\Program Files\QGIS Essen\bin;C:\Program 
Files\QGIS Essen\apps\qgis-ltr\bin;C:\Program Files\QGIS 
Essen\apps\python27\DLLs)

Sylvain


De : QGIS-Developer [mailto:qgis-developer-boun...@lists.osgeo.org] De la part 
de Anita Graser
Envoyé : dimanche 14 janvier 2018 15:07
À : qgis-dev
Objet : [QGIS-Developer] Eclipse config for QGIS API

Hi,

I've been following 
https://docs.qgis.org/testing/en/docs/pyqgis_developer_cookbook/ide_debugging.html
 to set up Eclipse including "Making eclipse understand the [QGIS] API"

When I import from qgis.core:

from qgis.core import qgsfunction, QgsExpression

qgsfunction is recognized but QgsExpression is not:

https://www.dropbox.com/s/zmbzllwu2egijbq/Screenshot%202018-01-14%2014.52.52.png?dl=0

My Python interpreter is set up as shown here

https://www.dropbox.com/s/ztnr4e6zbjkk35z/Screenshot%202018-01-14%2014.54.08.png?dl=0

Am I missing something to get full PyQGIS code completion?

Regards,
Anita


___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

[QGIS-Developer] Eclipse config for QGIS API

2018-01-14 Thread Anita Graser
Hi,

I've been following
https://docs.qgis.org/testing/en/docs/pyqgis_developer_cookbook/ide_debugging.html
to set up Eclipse including "Making eclipse understand the [QGIS] API"

When I import from qgis.core:

from qgis.core import qgsfunction, QgsExpression

qgsfunction is recognized but QgsExpression is not:

https://www.dropbox.com/s/zmbzllwu2egijbq/Screenshot%202018-01-14%2014.52.52.png?dl=0

My Python interpreter is set up as shown here

https://www.dropbox.com/s/ztnr4e6zbjkk35z/Screenshot%202018-01-14%2014.54.08.png?dl=0

Am I missing something to get full PyQGIS code completion?

Regards,
Anita
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer