[Solved] Using Raster calculator gives ERROR 000539

Paul Colomb Asks: Using Raster calculator gives ERROR 000539
I’m new with ArcGIS. I would like to do a calculate of NDWI. So I’m using Arctoolbox => Spatial analyst tools => Map Algebra => Raster calculator.

But when I’m trying to perform it, I get this error :

Code:
Executing: RasterCalculator "Float("LT05_L1TP_196030_19990113_20180215_01_T1_sr_band2.tif" - "LT05_L1TP_196030_19990113_20180215_01_T1_sr_band5.tif") / Float("LT05_L1TP_196030_19990113_20180215_01_T1_sr_band2.tif" + "LT05_L1TP_196030_19990113_20180215_01_T1_sr_band5.tif")" D:UserspaulcDocumentsSIG_ZHMNDWI1999_01_13_NDWI.tif
Start Time: Thu Oct 24 15:42:34 2019
Float(Raster(r"LT05_L1TP_196030_19990113_20180215_01_T1_sr_band2.tif") - Raster(r"LT05_L1TP_196030_19990113_20180215_01_T1_sr_band5.tif")) / Float(Raster(r"LT05_L1TP_196030_19990113_20180215_01_T1_sr_band2.tif") + Raster(r"LT05_L1TP_196030_19990113_20180215_01_T1_sr_band5.tif"))

ERROR 000539: Error running expression: rcexec() 
Traceback (most recent call last):
  File "<expression>", line 1, in <module>
  File "<string>", line 2, in rcexec
  File "c:program files (x86)arcgisdesktop10.3arcpyarcpy__init__.py", line 21, in <module>
    from arcpy.geoprocessing import gp
  File "c:program files (x86)arcgisdesktop10.3arcpyarcpygeoprocessing__init__.py", line 14, in <module>
    from _base import *
  File "c:program files (x86)arcgisdesktop10.3arcpyarcpygeoprocessing_base.py", line 598, in <module>
    env = GPEnvironments(gp)
  File "c:program files (x86)arcgisdesktop10.3arcpyarcpygeoprocessing_base.py", line 595, in GPEnvironments
    return GPEnvironment(geoprocessor)
  File "c:program files (x86)arcgisdesktop10.3arcpyarcpygeoprocessing_base.py", line 548, in __init__
    import weakref
  File "D:Programmes (x86)PythonLibweakref.py", line 14, in <module>
    from _weakref import (
ImportError: cannot import name _remove_dead_weakref

Failed to execute (RasterCalculator).

How can I fix this?

I have already tried to change the wayfolder for a shorter way, without space or special character, but it’s still like there is a problem with the wayfolder.

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.