When opening a tool like Hot Spot Analysis (Getis-Ord Gi*) tool as part of the Spatial Statistics Toolbox in ArcGIS, you receive an error like the one below:
Make sure that the system environment variable PYTHONPATH exists with the appropriate path to the toolboxes scripts. For example, for ArcGIS 10.4.x, it should be C:\Program Files (x86)\ArcGIS\Desktop10.4\ArcToolBox\Scripts
ArcGIS relies on the PYTHONPATH environment variable to know where the scripts attached to the toolboxes are. Without it being explicitly states in the system, ArcGIS fails to find the py files for the toolboxes.