AnsweredAssumed Answered

Spatial Statistics: Mean Center tool failed to work

Question asked by nanamzn on Sep 6, 2017
Latest reply on Sep 7, 2017 by curtvprice

Hi,

 

I need to generate the weighted centroid point using Mean Center tool. But it failed with the following error:

 

arcpy.MeanCenter_stats('Zip5_all_air', r'C:\Users\nanamzn\Documents\ArcGIS\Default.gdb\Zip3_MeanCenter', 'PackageNumber', '#', '#')
Runtime error  Traceback (most recent call last):   File "<string>", line 1, in <module>   File "c:\program files (x86)\arcgis\desktop10.5\arcpy\arcpy\stats.py", line 1231, in MeanCenter     raise e ExecuteError:  Traceback (most recent call last):   File "c:\program files (x86)\arcgis\desktop10.5\ArcToolbox\Scripts\MeanCenter.py", line 25, in <module>     import SSUtilities as UTILS   File "c:\program files (x86)\arcgis\desktop10.5\ArcToolbox\Scripts\SSUtilities.py", line 29, in <module>     import matplotlib.path as PATH   File "C:\Python27\ArcGIS10.5\lib\site-packages\matplotlib\__init__.py", line 129, in <module>     from matplotlib.externals.six.moves.urllib.request import urlopen   File "C:\Python27\ArcGIS10.5\lib\site-packages\matplotlib\externals\six.py", line 90, in __get__     result = self._resolve()   File "C:\Python27\ArcGIS10.5\lib\site-packages\matplotlib\externals\six.py", line 158, in _resolve     module = _import_module(self.mod)   File "C:\Python27\ArcGIS10.5\lib\site-packages\matplotlib\externals\six.py", line 80, in _import_module     __import__(name)   File "C:\Anaconda2\Lib\urllib2.py", line 94, in <module>     import httplib   File "C:\Anaconda2\Lib\httplib.py", line 72, in <module>     import socket   File "C:\Anaconda2\Lib\socket.py", line 47, in <module>     import _socket ImportError: DLL load failed: %1 is not a valid Win32 application.  Failed to execute (MeanCenter).  

 

 

I uninstalled Anaconda2 from my machine and rerun the tool. It failed again with different error. May I ask how to fix the problem?

 


>>> arcpy.MeanCenter_stats('Zip5_all_air', r'C:\Users\nanamzn\Documents\ArcGIS\Default.gdb\Zip3_MeanCenter1', 'PackageNumber', '#', '#')
Runtime error  Traceback (most recent call last):   File "<string>", line 1, in <module>   File "c:\program files (x86)\arcgis\desktop10.5\arcpy\arcpy\stats.py", line 1231, in MeanCenter     raise e ExecuteError:  Traceback (most recent call last):   File "c:\program files (x86)\arcgis\desktop10.5\ArcToolbox\Scripts\MeanCenter.py", line 25, in <module>     import SSUtilities as UTILS   File "c:\program files (x86)\arcgis\desktop10.5\ArcToolbox\Scripts\SSUtilities.py", line 29, in <module>     import matplotlib.path as PATH   File "C:\Python27\ArcGIS10.5\lib\site-packages\matplotlib\__init__.py", line 1138, in <module>     rcParams = rc_params()   File "C:\Python27\ArcGIS10.5\lib\site-packages\matplotlib\__init__.py", line 971, in rc_params     fname = matplotlib_fname()   File "C:\Python27\ArcGIS10.5\lib\site-packages\matplotlib\__init__.py", line 800, in matplotlib_fname     configdir = _get_configdir()   File "C:\Python27\ArcGIS10.5\lib\site-packages\matplotlib\__init__.py", line 655, in _get_configdir     return _get_config_or_cache_dir(_get_xdg_config_dir())   File "C:\Python27\ArcGIS10.5\lib\site-packages\matplotlib\__init__.py", line 580, in _get_xdg_config_dir     path = get_home()   File "C:\Python27\ArcGIS10.5\lib\site-packages\matplotlib\__init__.py", line 320, in wrapper     ret = func(*args, **kwargs)   File "C:\Python27\ArcGIS10.5\lib\site-packages\matplotlib\__init__.py", line 522, in _get_home     path = os.path.expanduser(b"~").decode(sys.getfilesystemencoding()) LookupError: unknown encoding: mbcs  Failed to execute (MeanCenter).

 

Thanks a lot!

 

Anna

Outcomes