Closed biglimp closed 3 years ago
@biglimp please try 2021.7.1 one hour later when it will be online.
Still not possible to install within a QGIS session but now possible to install via OSGeoShell outside of a session.
Maybe this helps:
Couldn't load plugin 'UMEP' due to an error when calling its classFactory() method
subprocess.CalledProcessError: Command '['C:\\OSGeo4W\\apps\\Python39\\pythonw.exe', '-m', 'pip', 'install', 'netCDF4', '-U', '--user']' returned non-zero exit status 1.
Traceback (most recent call last):
File "C:\Users/xlinfr/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP\suewsmodel\__init__.py", line 9, in
import supy as sp
File "C:\OSGeo4W/apps/qgis/./python\qgis\utils.py", line 799, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
ModuleNotFoundError: No module named 'supy'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users/xlinfr/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP\suewsmodel\supy_installer.py", line 102, in setup_supy
import supy as sp
File "C:\OSGeo4W/apps/qgis/./python\qgis\utils.py", line 799, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
ModuleNotFoundError: No module named 'supy'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\OSGeo4W/apps/qgis/./python\qgis\utils.py", line 335, in _startPlugin
plugins[packageName] = package.classFactory(iface)
File "C:\Users/xlinfr/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP\__init__.py", line 34, in classFactory
from .UMEP import UMEP
File "C:\OSGeo4W/apps/qgis/./python\qgis\utils.py", line 799, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:\Users/xlinfr/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP\UMEP.py", line 50, in
from .SuewsSimple.suews_simple import SuewsSimple
File "C:\OSGeo4W/apps/qgis/./python\qgis\utils.py", line 799, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:\Users/xlinfr/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP\SuewsSimple\suews_simple.py", line 35, in
from ..suewsmodel import suews_wrapper
File "C:\OSGeo4W/apps/qgis/./python\qgis\utils.py", line 799, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:\Users/xlinfr/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP\suewsmodel\__init__.py", line 17, in
setup_supy(ver=None)
File "C:\Users/xlinfr/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP\suewsmodel\supy_installer.py", line 108, in setup_supy
install_supy(ver)
File "C:\Users/xlinfr/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP\suewsmodel\supy_installer.py", line 58, in install_supy
str_info0 = subprocess.check_output(
File "C:\OSGeo4W\apps\Python39\lib\subprocess.py", line 424, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "C:\OSGeo4W\apps\Python39\lib\subprocess.py", line 528, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['C:\\OSGeo4W\\apps\\Python39\\pythonw.exe', '-m', 'pip', 'install', 'netCDF4', '-U', '--user']' returned non-zero exit status 1.
Python version: 3.9.5 (tags/v3.9.5:0a7dcbd, May 3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)]
QGIS version: 3.20.0-Odense Odense, decaadbb31
Python Path:
C:\Users/xlinfr/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP\SUEWSPrepare/Modules
C:\Users/xlinfr/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP\SUEWSPrepare/Modules
C:\Users/xlinfr/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_fusion
C:/OSGeo4W/apps/qgis/./python
C:/Users/xlinfr/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:/Users/xlinfr/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins
C:/OSGeo4W/apps/qgis/./python/plugins
C:\OSGeo4W\bin\python39.zip
C:\OSGeo4W\apps\Python39\DLLs
C:\OSGeo4W\apps\Python39\lib
C:\OSGeo4W\bin
C:\Users\xlinfr\AppData\Roaming\Python\Python39\site-packages
C:\OSGeo4W\apps\Python39
C:\OSGeo4W\apps\Python39\lib\site-packages
C:\OSGeo4W\apps\Python39\lib\site-packages\win32
C:\OSGeo4W\apps\Python39\lib\site-packages\win32\lib
C:\OSGeo4W\apps\Python39\lib\site-packages\Pythonwin
C:/Users/xlinfr/AppData/Roaming/QGIS/QGIS3\profiles\default/python
just had a test with QGIS3.20.1 on Mac and got no issue: UMEP works smoothly with required python dependencies installed as expected during the initialisation.
just reading through the error message again and found this line suspicious:
subprocess.CalledProcessError: Command '['C:\\OSGeo4W\\apps\\Python39\\pythonw.exe', '-m', 'pip', 'install', 'netCDF4', '-U', '--user']' returned non-zero exit status 1.
@biglimp can you try to run this line in your windows OSGeo terminal and let us know the results?
C:\\OSGeo4W\\apps\\Python39\\pythonw.exe -m pip install netCDF4 -U --user
I tried and pythonw.exe didnt work. I changed to python.exe and got the following error:
However, if I use pip install netCDF4
, the package is installed without errors.
@sunt05, your pull request only worked halfway.
Actually, I found that it is not QGIS version that decides where the python is located, it is the actual python version. Hence, we should check for python version and if we have 3.9 should do as we do now, when we identify QGIS 3.20. If lower version of python we should use the old location of python.
I noticed this as I installed the long term version of QGIS (3.16) alongside 3.20. 3.16 is using the same python version (3.9.5)
Fixed. Now Python version is used instead of QGIS version
I cannot use either pip install supy outside as well as inside of a QGIS session. Error that comes up when try (I forced the installation to stop as it goes on trying to install other versions of tables: