[Qgis-developer] Problem with setting up PyQGIS (QGIS 1.7.3)

Tim Sutton lists at linfiniti.com
Fri Jan 13 15:19:55 EST 2012


Hi Stefan

On Thu, Jan 12, 2012 at 10:45 AM, Kaps Stefan <stefan.kaps at vorarlberg.at> wrote:
> I am trying inside 2.5 qgis and now it works, but my arcpy scripts (2.6)
> don't work anymore - and the same vice versa...
>

Are you trying to mix arcpy scripts and QGIS scripts? I'm not much of
a windows guy but in the past I got things working by doing something
like this:

myapp.bat:
------------------

SET OSGEO4W_ROOT=C:\PROGRA~1\QUANTU~1
call "%OSGEO4W_ROOT%"\bin\o4w_env.bat
call "%OSGEO4W_ROOT%"\bin\gdal16.bat\apps
set PATH=%PATH%;C:\Program Files\Quantum GIS Tethys\bin;C:\Program
Files\Quantum GIS Tethys\apps\qgis\bin
set PYTHONPATH=C:\Program Files\Quantum GIS Tethys\apps\qgis\python
c:\Python25\python.exe myapp.py

myapp.py:
------------------

import sys
sys.path.append("C:\Program Files\Quantum GIS Tethys\apps\qgis\python")
import qgis.core


Which is pretty much Jürgens solution with an added explicit path
defination from within your initial python app.

Regards

Tim


> I am looking forward for your solution!
> Stefan
>
>
>
> ________________________________
> Von: Robin Cura [mailto:robin.cura at gmail.com]
> Gesendet: Donnerstag, 12. Januar 2012 09:37
> An: Kaps Stefan
> Cc: Jürgen E. Fischer; qgis-developer at lists.osgeo.org
>
> Betreff: Re: [Qgis-developer] Problem with setting up PyQGIS (QGIS 1.7.3)
>
> I haven't experienced for arcpy + pyqgis, but I had the same problem running
> arcpy + ogr lib.
>
> Whith which python version are you trying this ? Inside the 2.5 qgis python
> or the 2.6 arcpy python ?
>
> For my part, I had to use a 2.6 python (native, with connections to ogr),
> and import inside it arcpy, using an external file to "trick" arcpy.
> Can't say anymore now as I'm not on this computer, but I'll give you my
> complete solution later in the day.
>
> Cheers,
>
> Robin
>
> 2012/1/12 Kaps Stefan <stefan.kaps at vorarlberg.at>
>>
>> Hi Jürgen, Gary, Richard etc.
>> Thanks for your support! My problem was, that I have allready installed
>> python 2.6 for ArcGIS and this caused my problems when running my python
>> script! I am not able to run arcpy 2.6 and pyqgis 2.5 together - has someone
>> experience with arcpy (python 2.6) and pyqgis running together?
>>
>> Stefan
>>
>>
>>
>> -----Ursprüngliche Nachricht-----
>> Von: qgis-developer-bounces at lists.osgeo.org
>> [mailto:qgis-developer-bounces at lists.osgeo.org] Im Auftrag von Jürgen E.
>> Fischer
>> Gesendet: Mittwoch, 11. Januar 2012 17:39
>> An: qgis-developer at lists.osgeo.org
>> Betreff: Re: [Qgis-developer] Problem with setting up PyQGIS (QGIS 1.7.3)
>>
>> Hi Stefan,
>>
>> On Wed, 11. Jan 2012 at 08:52:27 +0000, Kaps Stefan wrote:
>> > I'm not able to set up the Python environment for standalone
>> > applications correctly, allthough there are several documentations on
>> > the internet -> I am using this one
>> > [1]http://www.qgis.org/pyqgis-cookbook/intro.html#python-applications,
>> > but
>>
>> Create a copy of the qgis.bat file in bin and replace the last line with a
>> call your python(w) script in the copy.  That should help.
>>
>>
>> Jürgen
>>
>>
>> --
>> Jürgen E. Fischer         norBIT GmbH               Tel.
>> +49-4931-918175-20
>> Dipl.-Inf. (FH)           Rheinstraße 13            Fax.
>> +49-4931-918175-50
>> Software Engineer         D-26506 Norden
>> http://www.norbit.de
>>
>> --
>> norBIT Gesellschaft fuer Unternehmensberatung und Informationssysteme mbH
>> Rheinstrasse 13, 26506 Norden
>> GF: Jelto Buurman, HR: Amtsgericht Emden, HRB 5502
>>
>> _______________________________________________
>> Qgis-developer mailing list
>> Qgis-developer at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>> _______________________________________________
>> Qgis-developer mailing list
>> Qgis-developer at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
>
>
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>



-- 
Tim Sutton - QGIS Project Steering Committee Member (Release  Manager)
==============================================
Please do not email me off-list with technical
support questions. Using the lists will gain
more exposure for your issues and the knowledge
surrounding your issue will be shared with all.

Visit http://linfiniti.com to find out about:
 * QGIS programming and support services
 * Mapserver and PostGIS based hosting plans
 * FOSS Consulting Services
Skype: timlinux
Irc: timlinux on #qgis at freenode.net
==============================================


More information about the Qgis-developer mailing list