GIS4WRF 在 QGIS 上构建失败

huangapple go评论78阅读模式
英文:

GIS4WRF on qgis fails to build

问题

我正在尝试使用 QGIS 3.28.8 安装 gis4wrf 插件。

我成功地按照以下步骤构建了 QGIS:

QGIS #####################################
#QGIS(量子地理信息系统)是一个免费开源的平台,允许用户分析、查看和编辑地理空间数据。它支持矢量和栅格图层,以及各种网络服务,并通过社区开发的插件进行扩展。其主要功能包括地图创建、空间分析和数据管理。
#############################################################################

echo $PASSWD | sudo -S sudo apt install bison build-essential ca-certificates ccache cmake cmake-curses-gui dh-python doxygen expect flex flip gdal-bin git graphviz grass-dev libexiv2-dev libexpat1-dev libfcgi-dev libgdal-dev libgeos-dev libgsl-dev libpdal-dev libpq-dev libproj-dev libprotobuf-dev libqca-qt5-2-dev libqca-qt5-2-plugins libqscintilla2-qt5-dev libqt5opengl5-dev libqt5serialport5-dev libqt5sql5-sqlite libqt5svg5-dev libqt5webkit5-dev libqt5xmlpatterns5-dev libqwt-qt5-dev libspatialindex-dev libspatialite-dev libsqlite3-dev libsqlite3-mod-spatialite libyaml-tiny-perl libzip-dev libzstd-dev lighttpd locales ninja-build ocl-icd-opencl-dev opencl-headers pandoc pdal pkg-config poppler-utils protobuf-compiler pyqt5-dev pyqt5-dev-tools pyqt5.qsci-dev python3-all-dev python3-autopep8 python3-dev python3-gdal python3-jinja2 python3-lxml python3-mock python3-nose2 python3-owslib python3-plotly python3-psycopg2 python3-pygments python3-pyproj python3-pyqt5 python3-pyqt5.qsci python3-pyqt5.qtmultimedia python3-pyqt5.qtpositioning python3-pyqt5.qtsql python3-pyqt5.qtsvg python3-pyqt5.qtwebkit python3-sip python3-sip-dev python3-termcolor python3-yaml qt3d-assimpsceneimport-plugin qt3d-defaultgeometryloader-plugin qt3d-gltfsceneio-plugin qt3d-scene2d-plugin qt3d5-dev qt5keychain-dev qtbase5-dev qtbase5-private-dev qtmultimedia5-dev qtpositioning5-dev qttools5-dev qttools5-dev-tools spawn-fcgi xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb -y

echo $PASSWD | sudo -S apt install gnupg software-properties-common

echo "Types: deb deb-src
URIs: https://qgis.org/ubuntu-ltr
Suites: jammy
Architectures: amd64
Components: main
Signed-By: /etc/apt/keyrings/qgis-archive-keyring.gpg" | sudo tee /etc/apt/sources.list.d/qgis.sources

echo $PASSWD | sudo -S sudo apt update
echo $PASSWD | sudo -S sudo apt install qgis python-qgis python3-qgis qgis-plugin-grass -y
echo $PASSWD | sudo -S sudo apt remove gdal-bin -y
echo $PASSWD | sudo -S sudo rm -f /var/lib/dpkg/info/qgis-providers
echo $PASSWD | sudo -S sudo apt install qgis -y
echo $PASSWD | sudo -S sudo apt update -y
echo $PASSWD | sudo -S sudo apt upgrade -y

然而,当我尝试下载 gis4wrf 插件时,出现了以下问题:

由于在调用其 classFactory() 方法时出现错误,无法加载插件 'gis4wrf'

ModuleNotFoundError: No module named 'netCDF4'
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/qgis/utils.py", line 423, in _startPlugin
plugins[packageName] = package.classFactory(iface)
File "/home/workhorse/.local/share/QGIS/QGIS3/profiles/default/python/plugins/gis4wrf/__init__.py", line 24, in classFactory
from gis4wrf.plugin.plugin import QGISPlugin
File "/usr/lib/python3/dist-packages/qgis/utils.py", line 888, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "/home/workhorse/.local/share/QGIS/QGIS3/profiles/default/python/plugins/gis4wrf/plugin/plugin.py", line 17, in
from gis4wrf.core import (
File "/usr/lib/python3/dist-packages/qgis/utils.py", line 888, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "/home/workhorse/.local/share/QGIS/QGIS3/profiles/default/python/plugins/gis4wrf/core/__init__.py", line 16, in
from gis4wrf.core.readers.wrf_netcdf_metadata import *
File "/usr/lib/python3/dist-packages/qgis/utils.py", line 888, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "/home/workhorse/.local/share/QGIS/QGIS3/profiles/default/python/plugins/gis4wrf/core/readers/wrf_netcdf_metadata.py", line 7, in
import netCDF4 as nc
File "/usr/lib/python3/dist-packages/qgis/utils.py", line 888, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
ModuleNotFoundError: No module named 'netCDF4'


Python 版本:3.10.6(主要版本,2023 年 529 日,11:10:38)[GCC 11.3.0]
QGIS 版本:3.28.8-Firenze Firenze,5ac45272b5

Python 路径:
/usr/share/qgis/python
/home/workhorse/.local/share/QGIS/QGIS3/profiles/default/python
/home/workhorse/.local/share/QGIS/QGIS3/profiles/default/python/plugins
/usr/share/qgis/python/plugins
/usr/lib/python310.zip
/usr/lib/python3.10
/usr/lib/python3.10/lib-dynload
/home/workhorse/.local/lib/python3.10/site-packages
/usr/local/lib/python3.10/dist-packages
/usr/lib/python3/dist-packages
/home/workhorse/.local/share/QGIS/QGIS3/profiles/default/python
/home/workhorse/.local/share/gis4wrf/python310/local/lib/python3.10/site-packages
/home/workhorse/.local/share/gis4wrf/python310/lib/python3/site-packages
/home/workhorse/.local/share/gis4wrf/python310/lib/python3.

<details>
<summary>英文:</summary>

I am trying to install gis4wrf using gqis 3.28.8

I am sucessfully able to build qgis by following these steps:
```shell
QGIS #####################################
#QGIS (Quantum Geographic Information System) is a free and open-source platform that allows users to 
#analyze, view, and edit geospatial data. It supports both vector and raster layers, as well as various #web services, and is extensible through community-developed plugins. Key features include map 
#creation, spatial analysis, and data management.
#############################################################################

echo $PASSWD | sudo -S sudo apt install bison build-essential ca-certificates ccache cmake cmake-curses-gui dh-python doxygen expect flex flip gdal-bin git graphviz grass-dev libexiv2-dev libexpat1-dev libfcgi-dev libgdal-dev libgeos-dev libgsl-dev libpdal-dev libpq-dev libproj-dev libprotobuf-dev libqca-qt5-2-dev libqca-qt5-2-plugins libqscintilla2-qt5-dev libqt5opengl5-dev libqt5serialport5-dev libqt5sql5-sqlite libqt5svg5-dev libqt5webkit5-dev libqt5xmlpatterns5-dev libqwt-qt5-dev libspatialindex-dev libspatialite-dev libsqlite3-dev libsqlite3-mod-spatialite libyaml-tiny-perl libzip-dev libzstd-dev lighttpd locales ninja-build ocl-icd-opencl-dev opencl-headers pandoc pdal pkg-config poppler-utils protobuf-compiler pyqt5-dev pyqt5-dev-tools pyqt5.qsci-dev python3-all-dev python3-autopep8 python3-dev python3-gdal python3-jinja2 python3-lxml python3-mock python3-nose2 python3-owslib python3-plotly python3-psycopg2 python3-pygments python3-pyproj python3-pyqt5 python3-pyqt5.qsci python3-pyqt5.qtmultimedia python3-pyqt5.qtpositioning python3-pyqt5.qtsql python3-pyqt5.qtsvg python3-pyqt5.qtwebkit python3-sip python3-sip-dev python3-termcolor python3-yaml qt3d-assimpsceneimport-plugin qt3d-defaultgeometryloader-plugin qt3d-gltfsceneio-plugin qt3d-scene2d-plugin qt3d5-dev qt5keychain-dev qtbase5-dev qtbase5-private-dev qtmultimedia5-dev qtpositioning5-dev qttools5-dev qttools5-dev-tools spawn-fcgi xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb -y

echo $PASSWD | sudo -S apt install gnupg software-properties-common

echo &quot;Types: deb deb-src
URIs: https://qgis.org/ubuntu-ltr
Suites: jammy
Architectures: amd64
Components: main
Signed-By: /etc/apt/keyrings/qgis-archive-keyring.gpg&quot; | sudo tee /etc/apt/sources.list.d/qgis.sources

echo $PASSWD | sudo -S sudo apt update
echo $PASSWD | sudo -S sudo apt install qgis python-qgis python3-qgis qgis-plugin-grass -y
echo $PASSWD | sudo -S sudo apt remove gdal-bin -y
echo $PASSWD | sudo -S sudo rm -f /var/lib/dpkg/info/qgis-providers
echo $PASSWD | sudo -S sudo apt install qgis -y
echo $PASSWD | sudo -S sudo apt update -y
echo $PASSWD | sudo -S sudo apt upgrade -y

However, when I try to download the gis4wrf plugin I get these issues:

Couldn&#39;t load plugin &#39;gis4wrf&#39; due to an error when calling its classFactory() method

ModuleNotFoundError: No module named &#39;netCDF4&#39;
Traceback (most recent call last):
File &quot;/usr/lib/python3/dist-packages/qgis/utils.py&quot;, line 423, in _startPlugin
plugins[packageName] = package.classFactory(iface)
File &quot;/home/workhorse/.local/share/QGIS/QGIS3/profiles/default/python/plugins/gis4wrf/__init__.py&quot;, line 24, in classFactory
from gis4wrf.plugin.plugin import QGISPlugin
File &quot;/usr/lib/python3/dist-packages/qgis/utils.py&quot;, line 888, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File &quot;/home/workhorse/.local/share/QGIS/QGIS3/profiles/default/python/plugins/gis4wrf/plugin/plugin.py&quot;, line 17, in
from gis4wrf.core import (
File &quot;/usr/lib/python3/dist-packages/qgis/utils.py&quot;, line 888, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File &quot;/home/workhorse/.local/share/QGIS/QGIS3/profiles/default/python/plugins/gis4wrf/core/__init__.py&quot;, line 16, in
from gis4wrf.core.readers.wrf_netcdf_metadata import *
File &quot;/usr/lib/python3/dist-packages/qgis/utils.py&quot;, line 888, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File &quot;/home/workhorse/.local/share/QGIS/QGIS3/profiles/default/python/plugins/gis4wrf/core/readers/wrf_netcdf_metadata.py&quot;, line 7, in
import netCDF4 as nc
File &quot;/usr/lib/python3/dist-packages/qgis/utils.py&quot;, line 888, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
ModuleNotFoundError: No module named &#39;netCDF4&#39;


Python version: 3.10.6 (main, May 29 2023, 11:10:38) [GCC 11.3.0]
QGIS version: 3.28.8-Firenze Firenze, 5ac45272b5

Python Path:
/usr/share/qgis/python
/home/workhorse/.local/share/QGIS/QGIS3/profiles/default/python
/home/workhorse/.local/share/QGIS/QGIS3/profiles/default/python/plugins
/usr/share/qgis/python/plugins
/usr/lib/python310.zip
/usr/lib/python3.10
/usr/lib/python3.10/lib-dynload
/home/workhorse/.local/lib/python3.10/site-packages
/usr/local/lib/python3.10/dist-packages
/usr/lib/python3/dist-packages
/home/workhorse/.local/share/QGIS/QGIS3/profiles/default/python
/home/workhorse/.local/share/gis4wrf/python310/local/lib/python3.10/site-packages
/home/workhorse/.local/share/gis4wrf/python310/lib/python3/site-packages
/home/workhorse/.local/share/gis4wrf/python310/lib/python3.10/site-packages

I was expecting the gis4wrf to download and install all the necessary files and folder for the plugin like it works on MacOS and Windows.

答案1

得分: 0

我对这个模块不太熟悉。但根据你的错误消息,

File &quot;/home/workhorse/.local/share/QGIS/QGIS3/profiles/default/python/plugins/gis4wrf/core/readers/wrf_netcdf_metadata.py&quot;, line 7, in
import netCDF4 as nc
#^^^^^^^^^^^^^^^^^^^^
File &quot;/usr/lib/python3/dist-packages/qgis/utils.py&quot;, line 888, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
ModuleNotFoundError: No module named &#39;netCDF4&#39;
#                    ^^^^^^^^^^^^^^^^^^^^^^^^

你没有安装这个Python库。

尝试使用 pip install netCDF4

英文:

I'm not familiar with the module. But according to your error message,

File &quot;/home/workhorse/.local/share/QGIS/QGIS3/profiles/default/python/plugins/gis4wrf/core/readers/wrf_netcdf_metadata.py&quot;, line 7, in
import netCDF4 as nc
#^^^^^^^^^^^^^^^^^^^^
File &quot;/usr/lib/python3/dist-packages/qgis/utils.py&quot;, line 888, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
ModuleNotFoundError: No module named &#39;netCDF4&#39;
#                    ^^^^^^^^^^^^^^^^^^^^^^^^

You didn't install the Python library for that.

Try pip install netCDF4

huangapple
  • 本文由 发表于 2023年7月3日 16:15:17
  • 转载请务必保留本文链接:https://go.coder-hub.com/76602966.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定