ghislainv / forestatrisk

📦🐍 Python package to model and forecast the risk of deforestation
https://ecology.ghislainv.fr/forestatrisk
GNU General Public License v3.0
116 stars 27 forks source link

CalledProcessError after running country_forest_run #69

Open ricardozwarg opened 2 years ago

ricardozwarg commented 2 years ago

Hi @ghislainv could you please give me some help here? I'm totally stuck with this error. I've tried several alternatives and haven't been able to resolve it. Any tips will help me a lot. Thanks.

far.data.country_forest_run( iso3, proj="EPSG:4326", output_dir="data_raw", keep_dir=True, fcc_source="gfc", perc=90, gdrive_remote_rclone="gdrive_zwarg", gdrive_folder="GEE-forestatrisk-notebooks")


CalledProcessError Traceback (most recent call last) ~\AppData\Local\Temp/ipykernel_15332/1526280857.py in 6 fcc_source="gfc", perc=90, 7 gdrive_remote_rclone="gdrive_zwarg", ----> 8 gdrive_folder="GEE-forestatrisk-notebooks")

~\miniconda3\envs\conda-far\lib\site-packages\forestatrisk\build_data\data.py in country_forest_run(iso3, proj, output_dir, keep_dir, fcc_source, perc, gdrive_remote_rclone, gdrive_folder) 170 # Check data availability 171 data_availability = ee_gfc.check(gdrive_remote_rclone, --> 172 gdrive_folder, iso3) 173 # If not available, run GEE 174 if data_availability is False:

~\miniconda3\envs\conda-far\lib\site-packages\forestatrisk\build_data\ee_gfc.py in check(gdrive_remote_rclone, gdrive_folder, iso3) 125 cmd = ["rclone", "lsf", "--include", pattern, remote_path] 126 cmd = " ".join(cmd) --> 127 out = subprocess.checkoutput(cmd, shell=True).decode("utf-8") 128 # Filename to find 129 fname = "forest" + iso3

~\miniconda3\envs\conda-far\lib\subprocess.py in check_output(timeout, *popenargs, *kwargs) 409 410 return run(popenargs, stdout=PIPE, timeout=timeout, check=True, --> 411 **kwargs).stdout 412 413

~\miniconda3\envs\conda-far\lib\subprocess.py in run(input, capture_output, timeout, check, *popenargs, **kwargs) 510 if check and retcode: 511 raise CalledProcessError(retcode, process.args, --> 512 output=stdout, stderr=stderr) 513 return CompletedProcess(process.args, retcode, stdout, stderr) 514

CalledProcessError: Command 'rclone lsf --include 'forest_BRA*.tif' gdrive_zwarg:GEE-forestatrisk-notebooks' returned non-zero exit status 1.

ghislainv commented 2 years ago

Hi Ricardo (@ricardozwarg),

The issue is not really detailed so I don't know exactly what could cause the error. You should probably check your rclone configuration.

Follow instructions on the rclone website on how to configure rclone with Google Drive. Then check the configuration with the following command in a terminal:

rclone lsd remote:

This should list the directories at the root of your drive.

Hope this helps, Best regards,

Ghislain