AnsweredAssumed Answered

Can't find expat module; probably python path issue

Question asked by MollyKFoley on Sep 5, 2019
Latest reply on Sep 5, 2019 by jborgion

I'm trying to use the Excel to Table tool and I get a long error message that culminates in this:

No module named expat; use SimpleXMLTreeBuilder instead  

I have already repaired my ArcGIS installation and that didn't fix it so moving on... Now, I know the expat module exists in the Python 2.7 folder that ArcGIS is supposed to use. When I print the python path in the python window in ArcMap, I get this:

['', 
u'c:\\program files (x86)\\arcgis\\desktop10.7\\arcpy',
'c:\\program files (x86)\\arcgis\\desktop10.7\\bin',
'c:\\program files (x86)\\arcgis\\desktop10.7\\ArcPy',
'c:\\program files (x86)\\arcgis\\desktop10.7\\ArcToolbox\\Scripts',
'C:\\WINDOWS\\SYSTEM32\\python27.zip',
'C:\\Users\\mfoley10\\AppData\\Local\\Continuum\\anaconda2\\Lib',
'C:\\Users\\mfoley10\\AppData\\Local\\Continuum\\anaconda2\\DLLs',
'C:\\Python27\\ArcGIS10.7\\Lib',
'C:\\Python27\\ArcGIS10.7\\DLLs',
'C:\\Python27\\ArcGIS10.7\\Lib\\lib-tk',
'C:\\WINDOWS\\system32',
'C:\\Python27\\ArcGIS10.7',
'C:\\Python27\\ArcGIS10.7\\lib\\site-packages']

 

I see that it's going into both Python27 folder and an anaconda2 folder. When I go to my registry keys though, I don't see a python 2.7 folder and instead I see 3.7. I have set up my python interpreter in Visual Studio to point to the Python 2.7 interpreter and it works there so all good in VS. It's just the problem in ArcMap. I'm not sure what to do from here. Do I change the Default, Executable, and Window Executable all to point to Python27? It's worth noting that all the other tools I've been using in ArcMap work fine, it's just this one that I've had problems with so far.

 

 

PythonPath folder has this in it:

 

The above screenshots are in the HKEY_LOCAL_MACHINE. When I go to HKEY_CURRENT_USER, these are the install and python paths which point to anaconda. Maybe these are the ones I need to change? The Visual Studio ones are correct because I have those pointing to the ArcGIS interpreter:

 

Outcomes