wonder-sk / qgis-first-aid-plugin

The must-have tool for QGIS Python plugin developers
GNU General Public License v2.0
47 stars 15 forks source link

users need to install future with Mac(?) QGIS #14

Closed hanleybrand closed 1 year ago

hanleybrand commented 6 years ago

I installed this plugin via the plugin manager in QGIS and got this error when QGIS tried to load the plugin:

2018-10-03T12:52:37     WARNING    Traceback (most recent call last):
              File "/Applications/QGIS3.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 312, in loadPlugin
              __import__(packageName)
              File "/Applications/QGIS3.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 674, in _import
              mod = _builtin_import(name, globals, locals, fromlist, level)
              File "/Users/hanley/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/firstaid/__init__.py", line 11, in 
              from .debuggerwidget import DebuggerWidget
              File "/Applications/QGIS3.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 674, in _import
              mod = _builtin_import(name, globals, locals, fromlist, level)
              File "/Users/hanley/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/firstaid/debuggerwidget.py", line 11, in 
              from past.builtins import execfile
              File "/Applications/QGIS3.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 674, in _import
              mod = _builtin_import(name, globals, locals, fromlist, level)
             ModuleNotFoundError: No module named 'past'

It was easily fixed by installing future (e.g. pip3 install future ) - as long as pip3 is pointed to the qgis python installation it should work.

Not sure if this is due to the OS the OS version, a change in QGIS 3(.2(2)), etc. In case it helps here's some information about my environment:

My machine: MacOS High Sierra (10.13.6)

QGIS version 3.2.2-Bonn QGIS code branch Release 3.2
Compiled against Qt 5.9.6 Running against Qt 5.9.6
Compiled against GDAL/OGR 2.2.4 Running against GDAL/OGR 2.2.4
Compiled against GEOS 3.6.2-CAPI-1.10.2 Running against GEOS 3.6.2-CAPI-1.10.2 4d2925d6
PostgreSQL Client Version 9.6.6 SpatiaLite Version 4.4.0-RC0
QWT Version 6.1.3 QScintilla2 Version 2.10.7
PROJ.4 Version 493

python3 (3.6.4): /Library/Frameworks/Python.framework/Versions/3.6/bin/python3 site-packages prior to installing future:

PeterPetrik commented 5 years ago

Lutra's Mac package contains future by default, see https://github.com/lutraconsulting/qgis-mac-packager/blob/master/scripts/install_brew.bash#L150

For official package, one has to install it manually as suggested

PeterPetrik commented 5 years ago

@wonder-sk I think that future is such common package that we should not bundle it in first-aid-plugin, what do you think? In that case I would close this ticket.

wonder-sk commented 5 years ago

The easiest will be to to just get rid of from past.builtins import execfile and rewrite execfile(filename, ...) to exec(open(filename).read(), ...) to get rid of the python2 syntax

ismailsunni commented 1 year ago

I am having the same problem

QGIS version 3.30.1-'s-Hertogenbosch QGIS code revision 447e8d717a
Qt version 5.15.3
Python version 3.10.6
GDAL/OGR version 3.4.1
PROJ version 8.2.1
EPSG Registry database version v10.041 (2021-12-03)
GEOS version 3.10.2-CAPI-1.16.0
SQLite version 3.37.2
PDAL version 2.3.0
PostgreSQL client version unknown
SpatiaLite version 5.0.1
QWT version 6.1.4
QScintilla2 version 2.11.6
OS version Pop!_OS 22.04 LTS
       

Active Python plugins pyqgis_resource_browser | 0.2.0 plugin_reloader | 0.9.3 qgis_resource_sharing | 1.0.0 qgis_hub_plugin | 0.1.0 db_manager | 0.1.20 grassprovider | 2.12.99 MetaSearch | 0.3.6 processing | 2.12.99