[Qgis-developer] Problem with my first plugin in Python

Francisco D. Salas Rosette fsalas at pinar.geocuba.cu
Wed Sep 17 08:36:27 PDT 2014


Hi,   
thanks Luigi and Gari by yours answer , but I could not configure well the pycharm with PyQGis, searching in internet find this document "Setting up PyCharm for PyQGIS and Qt" , and followed the instructions without success.  
I don't understand how configure the set PATH, set PYTHONHOM, and set PYTHONPATH variables, and which are the sets the variables that we need for the QGIS and Qt libs.  
  
The PyCharm IDE , don't recognise this modules : from qgis.core import QgsApplication  
  
If I use the python comand line show this message : no module named qgis.core  
  
How resolve this situation?
Regards, Francisco Salas


-----Mensaje original-----
De: Luigi Pirelli [mailto:luipir at gmail.com] 
Enviado el: miércoles, 17 de septiembre de 2014 06:41 a.m.
Para: Gary Sherman
CC: Francisco D. Salas Rosette; QGIS Developer Mailing List
Asunto: Re: [Qgis-developer] Problem with my first plugin in Python

probabily your're mixing pyqt4 from osgeo4w installation with pyqt4 as standalone installation (with python)... to solve it's a good shortcut launch your pycharm from a .bat script similar to that used to start QGIS (copy and edit it)... leave loading osgeo4w env and add pythonpath to point your qgis install.

Regards, Luigi Pirelli (luigi.pirelli at faunalia.it - luipir at gmail.com)

On 16 September 2014 22:57, Gary Sherman <gsherman at geoapt.com> wrote:
> To begin with, you need to be using Python 2.x from PyCharm (the one 
> included with your QGIS install).
>
> On Tue, Sep 16, 2014 at 12:18 PM, Francisco D. Salas Rosette 
> <fsalas at pinar.geocuba.cu> wrote:
>>
>> Hi,  I am novice in this topic and I use a QGis plugin builder , when 
>> I load the plugin in  PyCharm , is not possible accede the package 
>> PyQt4.QtGui, show this in  QtGui.py
>>
>>
>>
>> # encoding: utf-8
>>
>> # module PyQt4.QtGui
>>
>> # from D:\Python34\lib\site-packages\PyQt4\QtGui.pyd
>>
>> # by generator 1.124
>>
>>
>>
>> # Skeleton generation error:
>>
>> #
>>
>> #     Failed to process 'PyQt4.QtGui' while redoing innards of module
>> 'PyQt4.QtGui' "<module 'PyQt4.QtGui' from
>> 'D:\\\\Python34\\\\lib\\\\site-packages\\\\PyQt4\\\\QtGui.pyd'>": 
>> wrapped C/C++ object of type QApplication has been deleted
>>
>>
>>
>> How I could resolve this, because I need use for example : the Class 
>> QMessageBox, etc.
>>
>>
>>
>> Thanks!
>>
>>
>>
>> Best regards,
>>
>> Francisco Salas
>>
>>
>>
>>
>> _______________________________________________
>> Qgis-developer mailing list
>> Qgis-developer at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
>
>
>
> --
> -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
> Gary Sherman
> Chair, QGIS Project Steering Committee -Open Source GIS Books:
>  *http://locatepress.com
> -Alaska Novel:
>  *http://alaskana.co
> -Geospatial Consulting & Hosting:
>  *http://geoapt.com
> "We work virtually everywhere"
> -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
>
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
Este mensaje ha sido procesado por Kaspersky Security 8.0 para Linux Mail Server se ejecuta en el host relay.geocuba.cu Visita nuestra p gina de Internet: <http://www.kaspersky.com>, <http://www.viruslist.com>



More information about the Qgis-developer mailing list