planetfederal / qgis-mgrs-tools-plugin

GNU General Public License v2.0
6 stars 9 forks source link

software requirement and installation procedures #2

Closed cyrilQt closed 7 years ago

cyrilQt commented 9 years ago

Hi I get an issue when I tried to make use of this plugins. Here what i've done : 1)downloaded the plugins at https://github.com/boundlessgeo/mgrs-tools 2)unzipped in folder ://.qgis2/python/plugins/ As it didn't work i also : 3) renamed the folder //.qgis2/python/plugins/mgrs-tools-master as //.qgis2/python/plugins/mgrstools still not working 4) I downloaded the mgrs lib :https://github.com/hobu/mgrs And at this point it continues to display the plugin as broken. Qgis remains unable to load it. What did I missed? Where am I wrong? I work with an offline Windows 7 x64 Qgis 2.6 Brighton. Please help will more than appreciate. Thanks for reading.

cyrilQt commented 9 years ago

for more technical information, here is the message when mgrs tools get ticked ;

Traceback (most recent call last):
  File "D:/99-DAT~1/2-PROG~1/apps/qgis/./python\qgis\utils.py", line 208, in startPlugin
    plugins[packageName] = package.classFactory(iface)
  File "C:/Users/FalconView/.qgis2/python/plugins\mgrs-tools-masterinit.py", line 8, in classFactory
    from mgrstools import MGRSTools
  File "D:/99-DAT~1/2-PROG~1/apps/qgis/./python\qgis\utils.py", line 460, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:/Users/FalconView/.qgis2/python/plugins\mgrs-tools-master\mgrstools.py", line 9, in 
    from maptool import MGRSMapTool
  File "D:/99-DAT~1/2-PROG~1/apps/qgis/./python\qgis\utils.py", line 460, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:/Users/FalconView/.qgis2/python/plugins\mgrs-tools-master\maptool.py", line 1, in 
    import mgrs
  File "D:/99-DAT~1/2-PROG~1/apps/qgis/./python\qgis\utils.py", line 460, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:\Users\FalconView.qgis2\python\plugins\mgrs-tools-master\ext-libs\mgrsinit.py", line 1, in 
    from core import rt
  File "D:/99-DAT~1/2-PROG~1/apps/qgis/./python\qgis\utils.py", line 460, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:\Users\FalconView.qgis2\python\plugins\mgrs-tools-master\ext-libs\mgrs\core.py", line 17, in 
    rt = ctypes.PyDLL(lib_path)
  File "D:\99-DAT~1\2-PROG~1\apps\Python27\lib\ctypesinit.py", line 365, in init
    self._handle = _dlopen(self._name, mode)
WindowsError: [Error 193] %1 is not a valid Win32 application 
Version de Python :
2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)]


Version de QGIS :
2.6.1-Brighton Brighton, e2a51df

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

dakcarto commented 9 years ago

Hi @cyrilQ,

Renaming the plugin to mgrstools was appropriate. The plugin comes with 3 pre-compiled libmgrs libs for Win 32-bit, Mac 10.7+, and Linux:

libmgrs_mac.so
libmgrs.dll
libmgrs.so

There is custom code in ext-libs/mgrs/core.py to load the specific libmgrs per platform. However, those edits are only for POSIX platforms, not Windows.

The basic error you are seeing is WindowsError: [Error 193] %1 is not a valid Win32 application when Python is trying to open the libmgrs using the ctypes module. To remedy this, you can try a couple of things:

With regards to installing mgrs, you need to do so relative to the Python that QGIS on Win is using (usually bundled with it). You will need a specific compiler installed. Also, you will need to ensure that the built libmgrs.dll can be found on your PATH when launching QGIS. Due to these issues, this is why we package the libs with the plugin. :smiley:

cyrilQt commented 9 years ago

Hi Darkcarto, Thank you for you detailed answer. I 've started to follow your advice about Visual studio getting both with the specified link and executing them. So far when trying to make the mgrs plugin working it seems that the same error message occurred. As I'm learning Python from the basis, I 'll do what you advise about building, once I'm sure how to do that correctly (I'm still book 1, chap.1 of "How to learn Python" :p) Meanwhile I'm interested to know how to verify that libmgrs.dll can be found on my PATH when launching QGIS. And again, thanks for you help :)

cyrilQt commented 9 years ago

Hi again, I finally make it work, it is a very good tool and does all it is supposed to do correctly. Actually I downloaded a QGIS-32bits versions. I should have start from here I suppose, but you know how the newcomers are ;) Then everything runs perfectly with the Mgrstool, but now I encounter others problems of compatibility between my Win64 and Qgis 32bits that I have to fix :) but they are less annoying for me than no MGRS at all. See you and thanks for the help.

tsteles473 commented 8 years ago

Hi. I'm trying to install the plugin mgrs-tools on QGIS 2.14.1 and I've Ubuntu 14.04.4 LTS. I downloaded the plugin writing sudo git clone https://github.com/boundlessgeo/qgis-mgrs-tools-plugin.git mgrstools on /usr/share/qgis/python/plugins/mgrstools$ But when I try to see the installed plugin on QGIS, it says This plugin is broken. Anyone knows what's the problem? Thanks for attention

dakcarto commented 8 years ago

@tsteles473, please create new issues if your question/report is separate the current discussion thread.

As for your question, see http://qgis.boundlessgeo.com for info on adding the Boundless plugin repository to your QGIS. Most Boundless plugins need 'packaged' first, using a Python utility paver, so their code repos can not be used as is. This is not necessary if using the plugin repo, where plugins are already packaged and ready to install.

tsteles473 commented 8 years ago

Thanks a lot for the help.

Do you have any idea why i get this error now?

This plugin is broken /home/tsteles/.qgis2/python/plugins/mgrstools/ext-libs/mgrs/libmgrs.so: wrong ELF class: ELFCLASS64

dakcarto commented 8 years ago

@tsteles473, that ext-libs/mgrs/libmgrs.so library is for 64-bit Linux, with 32-bit unsupported. If you want 32-bit support, you will need to build it yourself.

tsteles473 commented 8 years ago

It works. Thanks a lot

alexbruy commented 7 years ago

New plugin version does not need precompiled libraries