UMEP-dev / UMEP

Urban Multi-scale Environmental Predictor
https://umep-docs.readthedocs.io/
59 stars 15 forks source link

BUGS when installing UMEP on QGIS 3.16.8 #309

Closed ML426 closed 3 years ago

ML426 commented 3 years ago

Discussed in https://github.com/UMEP-dev/UMEP/discussions/308

Originally posted by **ML426** August 9, 2021 ``` Python error : Unable to load the 'processing_umep' extension causes an error when calling its classFactory() method See the Python error log for more details 2021-08-09T10:16:41 WARNING warning:C:\PROGRA~1/QGIS31~1.8/apps/qgis-ltr/./python\qgis\utils.py:793: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses mod = _builtin_import(name, globals, locals, fromlist, level) traceback: File "", line 1, in File "C:\PROGRA~1/QGIS31~1.8/apps/qgis-ltr/./python\qgis\utils.py", line 354, in startPlugin if not _startPlugin(packageName): File "C:\PROGRA~1/QGIS31~1.8/apps/qgis-ltr/./python\qgis\utils.py", line 334, in _startPlugin plugins[packageName] = package.classFactory(iface) File "C:\Users/XXXX/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP\__init__.py", line 34, in classFactory from .UMEP import UMEP File "C:\PROGRA~1/QGIS31~1.8/apps/qgis-ltr/./python\qgis\utils.py", line 793, in _import mod = _builtin_import(name, globals, locals, fromlist, level) File "", line 1007, in _find_and_load File "", line 986, in _find_and_load_unlocked File "", line 680, in _load_unlocked File "", line 855, in exec_module File "", line 228, in _call_with_frames_removed File "C:\Users/XXXX/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP\UMEP.py", line 32, in from .SkyViewFactorCalculator.svf_calculator import SkyViewFactorCalculator File "C:\PROGRA~1/QGIS31~1.8/apps/qgis-ltr/./python\qgis\utils.py", line 793, in _import mod = _builtin_import(name, globals, locals, fromlist, level) File "", line 1007, in _find_and_load File "", line 986, in _find_and_load_unlocked File "", line 680, in _load_unlocked File "", line 855, in exec_module File "", line 228, in _call_with_frames_removed File "C:\Users/XXXX/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP\SkyViewFactorCalculator\svf_calculator.py", line 24, in from future import standard_library File "C:\PROGRA~1/QGIS31~1.8/apps/qgis-ltr/./python\qgis\utils.py", line 793, in _import mod = _builtin_import(name, globals, locals, fromlist, level) File "", line 1058, in _handle_fromlist File "", line 228, in _call_with_frames_removed File "", line 1007, in _find_and_load File "", line 986, in _find_and_load_unlocked File "", line 680, in _load_unlocked File "", line 855, in exec_module File "", line 228, in _call_with_frames_removed File "C:\PROGRA~1\QGIS31~1.8\apps\Python39\lib\site-packages\future\standard_library\__init__.py", line 65, in import imp File "C:\PROGRA~1/QGIS31~1.8/apps/qgis-ltr/./python\qgis\utils.py", line 793, in _import mod = _builtin_import(name, globals, locals, fromlist, level) File "", line 1007, in _find_and_load File "", line 986, in _find_and_load_unlocked File "", line 680, in _load_unlocked File "", line 855, in exec_module File "", line 228, in _call_with_frames_removed File "C:\PROGRA~1\QGIS31~1.8\apps\Python39\lib\imp.py", line 31, in warnings.warn("the imp module is deprecated in favour of importlib; " ```
rarygit commented 3 years ago

I think, it didn't found some packages. I'm using Qgis from anaconda platform (but i had the same problem without anaconda)

Although this issue has been answered in Discussion, I have some comments regarding using a conda environment in both Windows and Linux for QGIS and UMEP.

I always use miniconda (minimal conda), and never Anaconda as the package manager. Although Anaconda has a nice shiny interface, I often found it throwing conflicts when installing packages From my experience in minimising conflicts, I recommend conda-forge as the main channel.

Regarding pip, only use pip to install a package if there is no other option and only after you have set up your environment exactly as you need it. You want to avoid breaking your environment and ending up with package conflicts.

Creating a new miniconda environment is the best way to experiment and learn how to use conda. If you make a mistake, you can remove the environment.

For newcomers to miniconda, these webpages are indispensable: https://docs.conda.io/en/latest/miniconda.html https://docs.conda.io/projects/conda/en/latest/user-guide/install/download.html#anaconda-or-miniconda https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html https://docs.conda.io/projects/conda/en/latest/_downloads/843d9e0198f2a193a3484886fa28163c/conda-cheatsheet.pdf

I run a separate miniconda environment each for QGIS v3.16 LTR, v3.18 and next will be another for v3.20 I use the QGIS v3.18 to run the plugin gis4wrf and avoid netcdf conflicts. The QGIS v3.16 LTR environment is for production and stability. The QGIS v3.20 environment will be to experiment with new features.

It is easy and straight forward to run your all your conda environments from a separate fast SSD disk (e.g. SanDisk or other) that is not your Windows or Linux OS drive. There are tutorials on the internet for this. I found it easier under Ubuntu linux.

In other miniconda environments I am able to compile from source, run cuda code, implement other environments from a .yml text file .... etc

If one QGIS environment breaks or fails for some reason, then remove it and setup a new minimal conda environment.

That being said, there is a world of difference running miniconda on Ubuntu compared to the Windows file management system.

biglimp commented 3 years ago

Many thanks @rarygit for this detailed info! Would it be possible for to also add this into Discussion #308 so that other people can find it more easily also?

rarygit commented 3 years ago

@biglimp Yes certainly!

UMEP and all the opensource tools on UMEP-Dev are great to use. And I have found miniconda a relatively painless way to stabilise python package conflicts.

rarygit commented 3 years ago

I copied and pasted it to the Discussion #308