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

Jesse Ayers jrayers at u.washington.edu
Tue Jul 31 15:02:08 EDT 2007


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