Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: DLL load failed while importing _env: 找不到指定的模块。 #49

Open
KasMAX6 opened this issue Sep 23, 2024 · 4 comments

Comments

@KasMAX6
Copy link

KasMAX6 commented Sep 23, 2024

无法加载插件“Geo-SAM”

ImportError: DLL load failed while importing _env: 找不到指定的模块。
Traceback (most recent call last):
File "D:\app/qgis/apps/qgis/./python\qgis\utils.py", line 404, in loadPlugin
import(packageName)
File "D:\app/qgis/apps/qgis/./python\qgis\utils.py", line 923, in _import
mod = builtin_import(name, globals, locals, fromlist, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users/LOVE/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Geo-SAM_init
.py", line 7, in
from .geo_sam_tool import Geo_SAM
File "D:\app/qgis/apps/qgis/./python\qgis\utils.py", line 923, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users/LOVE/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Geo-SAM\geo_sam_tool.py", line 24, in
from .tools.SAMTool import SAM_Model
File "D:\app/qgis/apps/qgis/./python\qgis\utils.py", line 923, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users/LOVE/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Geo-SAM\tools\SAMTool.py", line 13, in
from .torchgeo_sam import SamTestFeatureDataset, SamTestFeatureGeoSampler
File "D:\app/qgis/apps/qgis/./python\qgis\utils.py", line 923, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users/LOVE/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Geo-SAM\tools\torchgeo_sam.py", line 21, in
from torchgeo.datasets import unbind_samples, stack_samples, BoundingBox, RasterDataset, GeoDataset, IntersectionDataset
File "D:\app/qgis/apps/qgis/./python\qgis\utils.py", line 923, in _import
mod = builtin_import(name, globals, locals, fromlist, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\app\qgis\apps\Python312\Lib\site-packages\torchgeo\datasets_init
.py", line 6, in
from .advance import ADVANCE
File "D:\app/qgis/apps/qgis/./python\qgis\utils.py", line 923, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\app\qgis\apps\Python312\Lib\site-packages\torchgeo\datasets\advance.py", line 19, in
from .geo import NonGeoDataset
File "D:\app/qgis/apps/qgis/./python\qgis\utils.py", line 923, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\app\qgis\apps\Python312\Lib\site-packages\torchgeo\datasets\geo.py", line 18, in
import fiona
File "D:\app/qgis/apps/qgis/./python\qgis\utils.py", line 923, in _import
mod = builtin_import(name, globals, locals, fromlist, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\app\qgis\apps\Python312\Lib\site-packages\fiona_init
.py", line 41, in
from fiona._env import (
File "D:\app/qgis/apps/qgis/./python\qgis\utils.py", line 923, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: DLL load failed while importing _env: 找不到指定的模块。

Python版本: 3.12.3 (main, Apr 14 2024, 17:21:43) [MSC v.1938 64 bit (AMD64)]
QGIS版本: 3.36.3-Maidenhead Maidenhead, 2df96554

@marcusspiegel
Copy link

I am having this same exact issue in case someone has a solution?

@summerclock
Copy link

Make sure u have latest fiona by running
pip install -U fiona
in OSGeo4W Shell, then reactivate the plugin, the problem should be solved.

@Fanchengyan
Copy link
Collaborator

I have tested installing Geo-SAM on Windows 11 for QGIS 3.40, and it is working fine. Make sure to open the “OSGeo4W Shell” as an administrator to install the dependencies, following the instructions at https://geo-sam.readthedocs.io/en/latest/installation.html.

@marcusspiegel
Copy link

Make sure u have latest fiona by running pip install -U fiona in OSGeo4W Shell, then reactivate the plugin, the problem should be solved.

Thank you! This was my issue. Just needed to upgrade fiona and then everything works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants