[Qgis-developer] QGIS 0.9 on windows:QgsApplication.setPrefixPath() has an invalid type

Aaron Racicot aaronr at z-pulley.com
Wed Aug 1 02:43:58 EDT 2007


Well, I have confirmed (on a new XP box) that after installing Python 2.5.1,
QT 4.3, SIP 4.7, PyQt 4.3.0, and QGIS from Tisham's zip file that QGIS works
(even the python console), but I can not get things to work with the simple
example I suggested below including the python bindings... that does work on
my linux dev box and my other Win dev box.  I get exactly the same behavior
as Jesse below when using the new preview zip.

To me this suggests that there is something amiss with the new preview build
that Tisham produced... but I am too tired to try and figure it out tonight.
So in summary:

1) On a fresh XP box and fresh installs of supporting libraries and the new
0.9 preview from Tisham I am not able to get the python bindings to work.

2) On XP, Ubuntu, and Mac OS I am able to get the python bindings to work
with a svn build of qgis and the same set of support libraries (also built
from source).  

I will try to work on this more tomorrow and see if I can work with Tisham
to get this issue resolved...

Aaron


+----------------------------------------+
 Aaron Racicot - GIS Programmer   
 360.221.2441 - aaronr at ecotrust.org          
+----------------------------------------+
 e c o t r u s t                        
 pobox 1614
 langley wa 98260
 www.ecotrust.org                       
+----------------------------------------+

-----Original Message-----
From: Jesse Ayers [mailto:jrayers at u.washington.edu] 
Sent: Tuesday, July 31, 2007 12:02 PM
To: 'Aaron Racicot'; qgis-developer at lists.qgis.org
Subject: RE: [Qgis-developer] QGIS 0.9 on
windows:QgsApplication.setPrefixPath() has an invalid type

This is a freshly formatted Windows XP install.  It has

Python 2.5.1
PyQt 4.3.0 (from here http://www.riverbankcomputing.co.uk/pyqt/download.php)
QGIS 0.9.0 Preview 1 from here
(http://whatnick.dyndns.org:8080/tisham/qgis0.9.0preview1.zip)

Installed in that order, and that's it!

--Jesse

 

>-----Original Message-----
>From: Aaron Racicot [mailto:aaronr at z-pulley.com] 
>Sent: Tuesday, July 31, 2007 11:54 AM
>To: 'Jesse Ayers'; qgis-developer at lists.qgis.org
>Subject: RE: [Qgis-developer] QGIS 0.9 on 
>windows:QgsApplication.setPrefixPath() has an invalid type
>
>Hmmm... strange.  I am not sure why your first statement that 
>is wrapped with a str() is returning a PyQt4.QtCore.QStringRef 
>object... I don't see that.  There seems to be some 
>strangeness with strings in your python install.  Can you show 
>what version of qgis, python, pyqt, qt, and how you installed them?  
>
>I guess we just need to start at the beginning and peel away 
>the onion until we get to the reason...
>
>A
>
>+----------------------------------------+
> Aaron Racicot - GIS Programmer   
> 360.221.2441 - aaronr at ecotrust.org          
>+----------------------------------------+
> e c o t r u s t                        
> pobox 1614
> langley wa 98260
> www.ecotrust.org                       
>+----------------------------------------+
>
>-----Original Message-----
>From: Jesse Ayers [mailto:jrayers at u.washington.edu]
>Sent: Tuesday, July 31, 2007 11:41 AM
>To: 'Aaron Racicot'; qgis-developer at lists.qgis.org
>Subject: RE: [Qgis-developer] QGIS 0.9 on
>windows:QgsApplication.setPrefixPath() has an invalid type
>
>Here you go:
>
>>>> from qgis.core import *
>>>> str(QgsApplication.prefixPath())
>'<PyQt4.QtCore.QStringRef object at 0x00BA1DF8>'
>>>> QgsApplication.setPrefixPath("C:/Program Files/qgis0.9.0preview1", 
>>>> True)
>
>Traceback (most recent call last):
>  File "<pyshell#2>", line 1, in <module>
>    QgsApplication.setPrefixPath("C:/Program 
>Files/qgis0.9.0preview1", True)
>TypeError: argument 1 of QgsApplication.setPrefixPath() has an 
>invalid type
>>>> str(QgsApplication.prefixPath())
>'<PyQt4.QtCore.QStringRef object at 0x0318C6F0>'
>>>> 
>
>
>Thanks!
>
>--Jesse
>
> 
>
>>-----Original Message-----
>>From: Aaron Racicot [mailto:aaronr at z-pulley.com]
>>Sent: Tuesday, July 31, 2007 11:37 AM
>>To: 'Jesse Ayers'; qgis-developer at lists.qgis.org
>>Subject: RE: [Qgis-developer] QGIS 0.9 on
>>windows:QgsApplication.setPrefixPath() has an invalid type
>>
>>Hi there Jesse,
>>
>>Can you try to just hit this function from the command line like:
>>
>>aaronr at z-linux2:~/work/$ python
>>Python 2.4.4c1 (#2, Oct 11 2006, 21:51:02) [GCC 4.1.2 20060928
>>(prerelease) (Ubuntu 4.1.1-13ubuntu5)] on linux2 Type "help", 
>>"copyright", "credits" or "license" for more information.
>>>>> from qgis.core import *
>>>>> str(QgsApplication.prefixPath())
>>''
>>>>> QgsApplication.setPrefixPath("/usr/local",True)
>>>>> str(QgsApplication.prefixPath())
>>'/usr/local'
>>>>>
>>
>>This will let us know if things are at least working in theory and we 
>>can track down why it is not working in your case.
>>
>>A
>>
>>+----------------------------------------+
>> Aaron Racicot - GIS Programmer   
>> 360.221.2441 - aaronr at ecotrust.org          
>>+----------------------------------------+
>> e c o t r u s t                        
>> pobox 1614
>> langley wa 98260
>> www.ecotrust.org                       
>>+----------------------------------------+
>>
>>-----Original Message-----
>>From: qgis-developer-bounces at lists.qgis.org
>>[mailto:qgis-developer-bounces at lists.qgis.org] On Behalf Of 
>Jesse Ayers
>>Sent: Tuesday, July 31, 2007 11:19 AM
>>To: qgis-developer at lists.qgis.org
>>Subject: [Qgis-developer] QGIS 0.9 on
>>windows:QgsApplication.setPrefixPath()
>>has an invalid type
>>
>>When attempting to run the \2_basic_main_window\mainwindow.py
>>script from the tutorials available here:
>>http://mapserver.sk/~wonder/qgis/tutorials.tar.gz
>>
>>I receive this error:
>>
>>Traceback (most recent call last):
>>  File "mainwindow.py", line 110, in <module>
>>    main(sys.argv)
>>  File "mainwindow.py", line 94, in main
>>    QgsApplication.setPrefixPath(qgis_prefix, True)
>>TypeError: argument 1 of QgsApplication.setPrefixPath() has 
>an invalid 
>>type
>>
>>Looking here
>>(http://svn.qgis.org/api_doc/html/classQgsApplication.html#4f54
>>0de6bcbc9ec14
>>dcf0499a9371c42) it would appear that a string is expected, which is 
>>what the mainwindow.py script above passes.
>>
>>Any ideas on solving this?
>>
>>Thanks in advance
>>
>>--
>>Jesse Ayers
>>Center for Urban Simulation and Policy Analysis University of 
>>Washington www.urbansim.org
>>
>>
>>_______________________________________________
>>Qgis-developer mailing list
>>Qgis-developer at lists.qgis.org
>>http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-developer
>>
>>
>
>




More information about the Qgis-developer mailing list