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

ModuleNotFoundError: No module named 'rasterio' #23

Open
mikdotou opened this issue Sep 29, 2023 · 2 comments
Open

ModuleNotFoundError: No module named 'rasterio' #23

mikdotou opened this issue Sep 29, 2023 · 2 comments

Comments

@mikdotou
Copy link

When I finish installation I get this error.

_```
Impossible de charger l'extension 'Geo-SAM'

ModuleNotFoundError: No module named 'rasterio'
Traceback (most recent call last):
File "C:\PROGRA1/QGIS321.10/apps/qgis-ltr/./python\qgis\utils.py", line 401, in loadPlugin
import(packageName)
File "C:\PROGRA1/QGIS321.10/apps/qgis-ltr/./python\qgis\utils.py", line 888, in _import
mod = builtin_import(name, globals, locals, fromlist, level)
File "C:\Users/Admin/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Geo-SAM_init
.py", line 7, in
from .geo_sam_tool import Geo_SAM
File "C:\PROGRA1/QGIS321.10/apps/qgis-ltr/./python\qgis\utils.py", line 888, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:\Users/Admin/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Geo-SAM\geo_sam_tool.py", line 24, in
from .tools.SAMTool import SAM_Model
File "C:\PROGRA1/QGIS321.10/apps/qgis-ltr/./python\qgis\utils.py", line 888, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:\Users/Admin/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Geo-SAM\tools\SAMTool.py", line 7, in
import rasterio
File "C:\PROGRA1/QGIS321.10/apps/qgis-ltr/./python\qgis\utils.py", line 888, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
ModuleNotFoundError: No module named 'rasterio'


Could you help me to fix it ?
Thanks
@Fanchengyan
Copy link
Collaborator

Fanchengyan commented Oct 3, 2023

Hi @mikdotou. Sorry for the late response. Have you installed dependencies? rasterio should be installed after installing torchgeo . If not, please follow the tutorial step-by-step to install them: https://geo-sam.readthedocs.io/en/latest/Installation.html#install-library-dependencies

@aobrien-fo
Copy link

I had the same issue. In my case, I mistakenly installed the dependencies using the Windows 'Powershell', which installed the packages to my OS environment (Python 3.11 in my case).

However, QGIS is using Python 3.9... so I was getting the 'module not found error'. Check your error further, and you will notice which version of Python QGIS is using.

My solution was to open the OSGeo4W Shell and install the necessary dependencies there using $ python -m pip install torch torchvision.

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

3 participants