I downloaded the GPX to shapefile tool and when I use it I get the following error message: 1 No module named re Failed to execute (gpx2shp).

Error Message

  • This is the full error message: <type 'exceptions.ImportError'>: No module named re Failed to execute (gpx2shp). – Jason Nov 14 '14 at 14:53
  • Do you have this python file C:\Python27\ArcGIS10.0\Lib\re.py on your computer? – artwork21 Nov 14 '14 at 15:19
  • I don't have experience/knowledge of python but it appears i do have that re - python file. It looks like i actually have 3 different re files. I am assuming the py stands for the type of file?? – Jason Nov 17 '14 at 14:45
  • Also says i have Python26. Anyway thanks for your original post. – Jason Nov 17 '14 at 14:46
  • In either ArcCatalog or ArcMap, open the Python window and try typing in import re then press enter. Any errors? – artwork21 Nov 17 '14 at 14:54

The script is failing to find the Python regular expression library, which is strange because re is part of core python.

You could open the Python console in ArcMap, and import re to see if the same error occurs.

As @artwork21 suggests, you could browse to your python installation and see if re.py exists.

You could start python from the command line and see what version is reported being installed (though re has been part of python since 1.6 or so). I'm not familiar with the tool you're using, but maybe you'll discover that python isn't in your path and this tool requires it?

Adding python to path

Follow the instructions here. On step 4, enter ;C:\python26\ArcGIS10.0 (be sure to verify this. Will be the same path you followed to run python in one of your comments)

If, after logging out and back in, you can type python at a command prompt and it works, I'll bet this tool will run as well.

  • Thanks for your suggestions. However i think this is above my knowledge. I have never worked with python before. I was hoping there would be a easy fix that i could do. Someone else i am working here at my office had no problems and we have downloaded the same tool and have the same group Arcview license. If you have any other suggestions or guidance on how to do what you have stated above let me know. – Jason Nov 17 '14 at 15:01
  • Try this: Open a command prompt and just type 'python'. If you drop to a python shell, type 'import re'. If it complains about not knowing what python is, I'd be willing to bet the issue is not having python in your PATH environment variable – wchatx Nov 17 '14 at 15:57
  • Okay, i tried that and it says that "python is not recoginized as an internal or external command, operable program or batch file". Would I be able to add python to my PATH environment variable? – Jason Nov 17 '14 at 16:39
  • In Windows Explorer (or command prompt, but I'm guessing explorer may be easier), browse to C:\Python26\ArcGIS10 and run python.exe. You should see a prompt with >>>. Try 'import re' there. – wchatx Nov 17 '14 at 17:50
  • Thanks again for your the suggestions. From that location when i enter 'import re' and press enter i get a new prompt with no error message. So i am guessing this means 're' is already here or the command has worked. However i still get the same error message when i try to run this tool. – Jason Nov 19 '14 at 15:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.