Bug report #6979

Couldn't load plugin openlayers_plugin due an error when calling its initGui() method

Added by Andy Wood about 11 years ago. Updated about 11 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:-
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:16084

Description

Using openlayers_plugin 1.0.0

Couldn't load plugin openlayers_plugin due an error when calling its initGui() method

Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/qgis/utils.py", line 198, in startPlugin
plugins[packageName].initGui()
File "/home/agw/.qgis//python/plugins/openlayers_plugin/openlayers_plugin.py", line 160, in initGui
if not self.__setCoordRSGoogle():
File "/home/agw/.qgis//python/plugins/openlayers_plugin/openlayers_plugin.py", line 211, in _setCoordRSGoogle
if not self.
_coordRSGoogle.createFromEpsg(idEpsgRSGoogle):
AttributeError: 'QgsCoordinateReferenceSystem' object has no attribute 'createFromEpsg'

Python version:
2.7.3rc2 (default, Apr 22 2012, 22:55:44)
[GCC 4.6.3]

QGIS version:
1.9.0-Master Master, 4ddcb3e

Python path: ['/home/agw/.qgis/python/plugins/GeoCoding', '/usr/share/qgis/python', '/home/agw/.qgis//python', '/home/agw/.qgis//python/plugins', '/usr/share/qgis/python/plugins', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PIL', '/usr/lib/python2.7/dist-packages/gst-0.10', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/pymodules/python2.7', '/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode']

buttonGitHub.png (3.93 KB) Salvatore Larosa, 2013-01-12 10:14 AM

openlayers_plugin.py Magnifier (9.99 KB) Salvatore Larosa, 2013-01-12 10:14 AM

History

#1 Updated by Salvatore Larosa about 11 years ago

  • Status changed from Open to Closed

duplicate of #6916

two possible workarounds at the moment:
1. http://goo.gl/yR0JE
2. apply this patch http://goo.gl/S9UkZ

#2 Updated by stefano campus about 11 years ago

in my case, first method doesn't work

Impossibile caricare il plugin openlayers a causa di errore chiamando il metodo classFactory()

Traceback (most recent call last):
File "C:/OSGeo4W/apps/qgis-dev/./python\\qgis\\utils.py", line 189, in startPlugin
plugins[packageName] = package.classFactory(iface)
File "C:/Documents and Settings/11186CS/.qgis//python/plugins\\openlayers\\__init__.py", line 48, in classFactory
from openlayers_plugin import OpenlayersPlugin
File "C:/OSGeo4W/apps/qgis-dev/./python\\qgis\\utils.py", line 438, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:/Documents and Settings/11186CS/.qgis//python/plugins\\openlayers\\openlayers_plugin.py", line 4

^
SyntaxError: invalid syntax

Versione Python:
2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)]

Versione di QGIS:
1.9.0-Master Master, be94fb7

#3 Updated by Salvatore Larosa about 11 years ago

very odd, it should work !
Have you selected "Raw" before of saved the file to plugin directory ?

#4 Updated by stefano campus about 11 years ago

forgive me, salvatore, i don't understand wthat do you mean with "raw"
i see another user who has same difficulty (http://gis.stackexchange.com/questions/46645/openlayers-plugin-and-qgis-1-9-error-after-install).

#5 Updated by Salvatore Larosa about 11 years ago

stefano campus wrote:

forgive me, salvatore, i don't understand wthat do you mean with "raw"

I am aware that was not a good advice !! :-)
Anyway, I meant the button on github (see attached image)

i see another user who has same difficulty (http://gis.stackexchange.com/questions/46645/openlayers-plugin-and-qgis-1-9-error-after-install).

Could you give a try with the attached py file ?

#6 Updated by Giovanni Manghi about 11 years ago

Salvatore Larosa wrote:

stefano campus wrote:

forgive me, salvatore, i don't understand wthat do you mean with "raw"

I am aware that was not a good advice !! :-)
Anyway, I meant the button on github (see attached image)

i see another user who has same difficulty (http://gis.stackexchange.com/questions/46645/openlayers-plugin-and-qgis-1-9-error-after-install).

Could you give a try with the attached py file ?

with the attached patched file the plugin works as expected, can someone make a push with the maintainers to have the plugin updated?

#7 Updated by Jürgen Fischer about 11 years ago

Giovanni Manghi wrote:

with the attached patched file the plugin works as expected, can someone make a push with the maintainers to have the plugin updated?

Please follow up in the plugin's ticket #6916 - this ticket is closed.

Also available in: Atom PDF