mdbartos / pysheds

:earth_americas: Simple and fast watershed delineation in python.
GNU General Public License v3.0
710 stars 195 forks source link

ImportError: Requires rasterio module #145

Open MaartenVL opened 3 years ago

MaartenVL commented 3 years ago

I created a new conda python (3.8) environment in pycharm. installed following packages using conda install --file requirements.txt (from the terminal)

pysheds
matplotlib
numpy
fiona

after running a basic script using pysheds, I get following error:

ImportError: Requires rasterio module

executing the folowing:

from pysheds.grid import Grid
import matplotlib.pyplot as plt
import numpy as np
import fiona

grid = Grid.from_raster('gis/DHM_clipped.tif', data_name='DHM_clipped')

This is what I get from conda list:

# Name                    Version                   Build  Channel
affine                    2.3.0                      py_0    conda-forge
appdirs                   1.4.4              pyh9f0ad1d_0    conda-forge
attrs                     21.2.0             pyhd8ed1ab_0    conda-forge
blosc                     1.21.0               h0e60522_0    conda-forge
boost-cpp                 1.74.0               h5b4e17d_4    conda-forge
brotli                    1.0.9                h8ffe710_5    conda-forge
brotli-bin                1.0.9                h8ffe710_5    conda-forge
brotlipy                  0.7.0           py38h294d835_1001    conda-forge
bzip2                     1.0.8                h8ffe710_4    conda-forge
ca-certificates           2021.5.30            h5b45459_0    conda-forge
cairo                     1.16.0            hb19e0ff_1008    conda-forge
certifi                   2021.5.30        py38haa244fe_0    conda-forge
cffi                      1.14.6           py38hd8c33c5_0    conda-forge
cfitsio                   3.470                h0af3d06_7    conda-forge
chardet                   4.0.0            py38haa244fe_1    conda-forge
charls                    2.2.0                h39d44d4_0    conda-forge
charset-normalizer        2.0.0              pyhd8ed1ab_0    conda-forge
click                     7.1.2              pyh9f0ad1d_0    conda-forge
click-plugins             1.1.1                      py_0    conda-forge
cligj                     0.7.2              pyhd8ed1ab_0    conda-forge
cloudpickle               1.6.0                      py_0    conda-forge
cryptography              3.4.7            py38hd7da0ea_0    conda-forge
curl                      7.78.0               h789b8ee_0    conda-forge
cycler                    0.10.0                     py_2    conda-forge
cytoolz                   0.11.0           py38h294d835_3    conda-forge
dask-core                 2021.8.0           pyhd8ed1ab_0    conda-forge
decorator                 5.0.9              pyhd8ed1ab_0    conda-forge
expat                     2.4.1                h39d44d4_0    conda-forge
fiona                     1.8.20           py38hbf36ab5_1    conda-forge
fontconfig                2.13.1            h1989441_1005    conda-forge
freetype                  2.10.4               h546665d_1    conda-forge
freexl                    1.0.6                ha8e266a_0    conda-forge
fsspec                    2021.7.0           pyhd8ed1ab_0    conda-forge
gdal                      3.3.1            py38hacca965_1    conda-forge
geojson                   2.5.0                      py_0    conda-forge
geos                      3.9.1                h39d44d4_2    conda-forge
geotiff                   1.6.0                ha8a8a2d_6    conda-forge
gettext                   0.19.8.1          h1a89ca6_1005    conda-forge
giflib                    5.2.1                h8d14728_2    conda-forge
hdf4                      4.2.15               h0e5069d_3    conda-forge
hdf5                      1.10.6          nompi_h5268f04_1114    conda-forge
icu                       68.1                 h0e60522_0    conda-forge
idna                      3.1                pyhd3deb0d_0    conda-forge
imagecodecs               2021.6.8         py38hb6d6902_0    conda-forge
imageio                   2.9.0                      py_0    conda-forge
intel-openmp              2021.3.0          h57928b3_3372    conda-forge
jbig                      2.1               h8d14728_2003    conda-forge
jpeg                      9d                   h8ffe710_0    conda-forge
jxrlib                    1.1                  h8ffe710_2    conda-forge
kealib                    1.4.14               h96bfa42_2    conda-forge
kiwisolver                1.3.1            py38hbd9d945_1    conda-forge
krb5                      1.19.2               hbae68bd_0    conda-forge
lcms2                     2.12                 h2a16943_0    conda-forge
lerc                      2.2.1                h0e60522_0    conda-forge
libaec                    1.0.5                h39d44d4_0    conda-forge
libblas                   3.9.0              11_win64_mkl    conda-forge
libbrotlicommon           1.0.9                h8ffe710_5    conda-forge
libbrotlidec              1.0.9                h8ffe710_5    conda-forge
libbrotlienc              1.0.9                h8ffe710_5    conda-forge
libcblas                  3.9.0              11_win64_mkl    conda-forge
libclang                  11.1.0          default_h5c34c98_1    conda-forge
libcurl                   7.78.0               h789b8ee_0    conda-forge
libdeflate                1.7                  h8ffe710_5    conda-forge
libffi                    3.3                  h0e60522_2    conda-forge
libgdal                   3.3.1                ha6cada3_1    conda-forge
libglib                   2.68.3               h1e62bf3_0    conda-forge
libiconv                  1.16                 he774522_0    conda-forge
libkml                    1.3.0             h9859afa_1014    conda-forge
liblapack                 3.9.0              11_win64_mkl    conda-forge
libnetcdf                 4.8.0           nompi_hf689e7d_103    conda-forge
libpng                    1.6.37               h1d00b33_2    conda-forge
libpq                     13.3                 hfcc5ef8_0    conda-forge
librttopo                 1.1.0                hb340de5_6    conda-forge
libspatialite             5.0.1                h762a7f4_5    conda-forge
libssh2                   1.9.0                h680486a_6    conda-forge
libtiff                   4.3.0                h0c97f57_1    conda-forge
libwebp-base              1.2.1                h8ffe710_0    conda-forge
libxml2                   2.9.12               hf5bbc77_0    conda-forge
libzip                    1.8.0                hfed4ece_0    conda-forge
libzopfli                 1.0.3                h0e60522_0    conda-forge
locket                    0.2.0                      py_2    conda-forge
lz4-c                     1.9.3                h8ffe710_1    conda-forge
m2w64-gcc-libgfortran     5.3.0                         6    conda-forge
m2w64-gcc-libs            5.3.0                         7    conda-forge
m2w64-gcc-libs-core       5.3.0                         7    conda-forge
m2w64-gmp                 6.1.0                         2    conda-forge
m2w64-libwinpthread-git   5.0.0.4634.697f757               2    conda-forge
matplotlib                3.4.3            py38haa244fe_0    conda-forge
matplotlib-base           3.4.3            py38h1f000d6_0    conda-forge
mkl                       2021.3.0           hb70f87d_564    conda-forge
msys2-conda-epoch         20160418                      1    conda-forge
munch                     2.5.0                      py_0    conda-forge
networkx                  2.5                        py_0    conda-forge
numpy                     1.21.2           py38h089cfbf_0    conda-forge
olefile                   0.46               pyh9f0ad1d_1    conda-forge
openjpeg                  2.4.0                hb211442_1    conda-forge
openssl                   1.1.1k               h8ffe710_1    conda-forge
packaging                 21.0               pyhd8ed1ab_0    conda-forge
pandas                    1.3.2            py38h5d928e2_0    conda-forge
partd                     1.2.0              pyhd8ed1ab_0    conda-forge
pcre                      8.45                 h0e60522_0    conda-forge
pillow                    8.3.1            py38h794f750_0    conda-forge
pip                       21.2.4             pyhd8ed1ab_0    conda-forge
pixman                    0.40.0               h8ffe710_0    conda-forge
pooch                     1.4.0              pyhd8ed1ab_0    conda-forge
poppler                   21.03.0              h9ff6ed8_0    conda-forge
poppler-data              0.4.10                        0    conda-forge
postgresql                13.3                 h1c22c4f_0    conda-forge
proj                      8.0.1                h1cfcee9_0    conda-forge
pycparser                 2.20               pyh9f0ad1d_2    conda-forge
pyopenssl                 20.0.1             pyhd8ed1ab_0    conda-forge
pyparsing                 2.4.7              pyh9f0ad1d_0    conda-forge
pyproj                    3.1.0            py38habcafb0_4    conda-forge
pyqt                      5.12.3           py38haa244fe_7    conda-forge
pyqt-impl                 5.12.3           py38h885f38d_7    conda-forge
pyqt5-sip                 4.19.18          py38h885f38d_7    conda-forge
pyqtchart                 5.12             py38h885f38d_7    conda-forge
pyqtwebengine             5.12.1           py38h885f38d_7    conda-forge
pysheds                   0.2.7            py38h294d835_1    conda-forge
pysocks                   1.7.1            py38haa244fe_3    conda-forge
python                    3.8.10          h7840368_1_cpython    conda-forge
python-dateutil           2.8.2              pyhd8ed1ab_0    conda-forge
python_abi                3.8                      2_cp38    conda-forge
pytz                      2021.1             pyhd8ed1ab_0    conda-forge
pywavelets                1.1.1            py38h347fdf6_3    conda-forge
pyyaml                    5.4.1            py38h294d835_1    conda-forge
qt                        5.12.9               h5909a2a_4    conda-forge
rasterio                  1.2.6            py38h352701c_2    conda-forge
requests                  2.26.0             pyhd8ed1ab_0    conda-forge
scikit-image              0.18.2           py38h60cbd38_0    conda-forge
scipy                     1.7.1            py38ha1292f7_0    conda-forge
setuptools                57.4.0           py38haa244fe_0    conda-forge
shapely                   1.7.1            py38h127f298_5    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
snappy                    1.1.8                ha925a31_3    conda-forge
snuggs                    1.4.7                      py_0    conda-forge
sqlite                    3.36.0               h8ffe710_0    conda-forge
tbb                       2021.3.0             h2d74725_0    conda-forge
tifffile                  2021.7.2           pyhd8ed1ab_0    conda-forge
tiledb                    2.3.3                h78dabda_0    conda-forge
tk                        8.6.10               h8ffe710_1    conda-forge
toolz                     0.11.1                     py_0    conda-forge
tornado                   6.1              py38h294d835_1    conda-forge
ucrt                      10.0.20348.0         h57928b3_0    conda-forge
urllib3                   1.26.6             pyhd8ed1ab_0    conda-forge
vc                        14.2                 hb210afc_5    conda-forge
vs2015_runtime            14.29.30037          h902a5da_5    conda-forge
wheel                     0.37.0             pyhd8ed1ab_1    conda-forge
win_inet_pton             1.1.0            py38haa244fe_2    conda-forge
xerces-c                  3.2.3                h0e60522_2    conda-forge
xz                        5.2.5                h62dcd97_1    conda-forge
yaml                      0.2.5                he774522_0    conda-forge
zfp                       0.5.5                h0e60522_5    conda-forge
zlib                      1.2.11            h62dcd97_1010    conda-forge
zstd                      1.5.0                h6255e5f_0    conda-forge
yjx12345 commented 2 years ago

Have you solved the problem?If you solved it ,Please contact me ,email:jinxin.yao@cug.edu.cn

mdbartos commented 2 years ago

Can you post the full traceback?

I also posted a major update to pysheds a few days ago with several fixes. I'd highly recommend upgrading to pysheds v0.3.