Select to view content in your preferred language

Write Feature to Text: <type 'exceptions.ImportError'>: No module named string Failed

768
3
02-13-2012 03:59 PM
WesChristensen
New Contributor
Hi,

I am trying to accomplish a fairly simple task: ArcToolbox>Samples>Data management>Write features to text.  I get the following error:

<type 'exceptions.ImportError'>: No module named string
Failed to execute



The feature is a simple polygon.  The Google hints at some trouble with python, but only mentions "no module name BLAH", but no mention of "no module name string."  I followed that advice and checked my environment variables, put c:/Python27/ as the first entry in PATH and PYTHONPATH, but no luck.

This should be simple... but alas, it isn't!!!

Any help is much appreciated.

Windows XP
ArcMap 9.3
Python 2.7
Tags (2)
0 Kudos
3 Replies
StacyRendall1
Frequent Contributor
Wes,

Python 2.7 is not the version that comes with ArcGIS 9.3. Arc actually installs its own Python. If you have installed another Python, there is possibly a conflict between the two. It is possible to have multiple Python installations, including one that works with Arc, but you have to be a little careful about how you set it up.

Did you let Arc install its own Python distribution? Did you try to delete or uninstall this one before installing 2.7? Was 2.7 already on your computer before installing Arc?

The quick and dirty solution would be something like:

  1. uninstall Arc

  2. uninstall Python (all versions)

  3. reboot computer

  4. install Arc (and make sure it installs its Python - there is an option somewhere)

0 Kudos
RDHarles
Regular Contributor
Please post your script.
0 Kudos
WesChristensen
New Contributor
Thanks for the replies.

Stacy, I installed Python 2.5.1 and everything works fine.  Thanks!!!!
0 Kudos