I'm about creating a python plugin for my project , I already compiled it but I'm now facing a real problem while the installation , it seems to me that there is issue about the version but I'm not sure ... this is the error O get :

Impossible de charger l'extension dataexporter provoque une erreur lors de l'appel de sa méthode classFactory()

Traceback (most recent call last): File "C:/PROGRA~1/QGISBR~1/apps/qgis/./python\qgis\utils.py", line 208, in startPlugin plugins[packageName] = package.classFactory(iface) File "C:/Users/soukaina/.qgis2/python/plugins\dataexporter__init__.py", line 34, in classFactory from .dataexporter import dataexporter ImportError: cannot import name dataexporter

Version de Python : 2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)]

Version de QGIS : 2.6.0-Brighton Brighton, exported

Chemin vers Python : ['C:/PROGRA~1/QGISBR~1/apps/qgis/./python', u'C:/Users/soukaina/.qgis2/python', u'C:/Users/soukaina/.qgis2/python/plugins', 'C:/PROGRA~1/QGISBR~1/apps/qgis/./python/plugins', 'C:\PROGRA~1\QGISBR~1\apps\Python27\lib\site-packages\matplotlib-1.3.1-py2.7-win-amd64.egg', 'C:\PROGRA~1\QGISBR~1\apps\Python27\lib\site-packages\nose-1.3.3-py2.7.egg', 'C:\PROGRA~1\QGISBR~1\apps\Python27\lib\site-packages\tornado-4.0.1-py2.7-win-amd64.egg', 'C:\PROGRA~1\QGISBR~1\apps\Python27\lib\site-packages\backports.ssl_match_hostname-', 'C:\PROGRA~1\QGISBR~1\apps\Python27\lib\site-packages\certifi-14.05.14-py2.7.egg', 'C:\PROGRA~1\QGISBR~1\bin\python27.zip', 'C:\PROGRA~1\QGISBR~1\apps\Python27\DLLs', 'C:\PROGRA~1\QGISBR~1\apps\Python27\lib', 'C:\PROGRA~1\QGISBR~1\apps\Python27\lib\plat-win', 'C:\PROGRA~1\QGISBR~1\apps\Python27\lib\lib-tk', 'C:\PROGRA~1\QGISBR~1\bin', 'C:\PROGRA~1\QGISBR~1\apps\Python27', 'C:\PROGRA~1\QGISBR~1\apps\Python27\lib\site-packages', 'C:\PROGRA~1\QGISBR~1\apps\Python27\lib\site-packages\PIL', 'C:\PROGRA~1\QGISBR~1\apps\Python27\lib\site-packages\jinja2-2.7.2-py2.7.egg', 'C:\PROGRA~1\QGISBR~1\apps\Python27\lib\site-packages\markupsafe-0.23-py2.7-win-amd64.egg', 'C:\PROGRA~1\QGISBR~1\apps\Python27\lib\site-packages\pytz-2012j-py2.7.egg', 'C:\PROGRA~1\QGISBR~1\apps\Python27\lib\site-packages\win32', 'C:\PROGRA~1\QGISBR~1\apps\Python27\lib\site-packages\win32\lib', 'C:\PROGRA~1\QGISBR~1\apps\Python27\lib\site-packages\Pythonwin', 'C:\PROGRA~1\QGISBR~1\apps\Python27\lib\site-packages\Shapely-1.2.18-py2.7-win-amd64.egg', 'C:\PROGRA~1\QGISBR~1\apps\Python27\lib\site-packages\six-1.3.0-py2.7.egg', 'C:\PROGRA~1\QGISBR~1\apps\Python27\lib\site-packages\wx-2.8-msw-unicode', 'C:\PROGRA~1\QGISBR~1\apps\Python27\lib\site-packages\xlrd-0.9.2-py2.7.egg', 'C:\PROGRA~1\QGISBR~1\apps\Python27\lib\site-packages\xlwt-0.7.5-py2.7.egg']

closed as unclear what you're asking by underdark Feb 28 '15 at 18:46

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • We need to see the code of dataexporter.py – underdark Jan 19 '15 at 21:10

It seems like something is wrong with your __init__ file. First you have to name it only __init__.py and it should contain

def classFactory(iface):
    from YourPlugin import PluginName
     return PluginName(iface)

If you are new to programming plugins you should follow the qgis cookbook How to write a Qgis plugin

If you follow this steps there shouldn't be a problem.


I had the same issue with this and i figured that while you are on the OSGeo4W console, after you compile it with this command: pyrcc4 -o resources.py resources.qrc THEN all i did was type: make test

then the next time i started QGIS i got no errors whatsoever. hope this helps

Not the answer you're looking for? Browse other questions tagged or ask your own question.