AttributeError: <unprintable AttributeError object>  when running on ArcGIS10

2456
15
02-18-2011 12:27 PM
hanyhassaballa
New Contributor II
i have installed ArcGIS 10, and i am getting this error:
AttributeError: <unprintable AttributeError object>

when i am trying to run python script that were develop in ArcGIS 9.3, what could be the problem.
Tags (2)
0 Kudos
15 Replies
ChristopherStorer
New Contributor
My fault, I'm used to working in more complex environments.  Take out the loggers and use print statements to send the errors to the screen:

    try:
        print("Place code here")

    except arcpy.ExecuteError:
        Errors = "TRUE"
        print("An error occurred during geoprocessing:")
        print(arcpy.GetMessages(2))
    except Exception as ErrorDesc:
        Errors = "TRUE"
        print("An unknown error occurred:")
        print(ErrorDesc.message)
0 Kudos
yoanndrocourt
New Contributor
ok, that is becoming clrearer now...
so it seems that it doesn't find the toolbox right?
but I am importing it...don't really know what I can do...I was wondering if the space in the nam eof the toolbox could cause this to happen.

An unknown error occurred:
F:\front\trash\test.py:41: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
  logger.error(ErrorDesc.message)
Object: Tool or environment <????????????????????> not found
0 Kudos
ChristopherStorer
New Contributor
I can't imagine the space being a problem, but it's worth trying.  I would think if the tool truly didn't exist, it would have failed at the top while you were trying to import it.
0 Kudos
George_ChandeepCorea
New Contributor III
Greetings...was there a fix to this?

I get the following...

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    arcpy.CopyFeatures_management(polygon, ShapeFile_prj)
  File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\management.py", line 1943, in CopyFeatures
    raise e
AttributeError: <unprintable AttributeError object>


where
>>> polygon
<Polygon object at 0xf34f550[0x347d9e0]>
>>> ShapeFile_prj
'F:\\vector\\Biboohra_Koah\\25cm\\TPE0_330000_8135000_1k_cont.shp'
>>> 


My full script is attached. This should work on any directory with ESRI readable vector files.

best,
0 Kudos
curtvprice
MVP Esteemed Contributor
I have seen this AttributeError when there are two toolboxes active with the same alias. In this situation, ArcGIS has trouble accessing the correct tool because of the alias conflict.
0 Kudos
LaurensKusse
New Contributor
Right mouse click on the toolbox, select properties and add an alias on the General tab, solved this problem for me.
0 Kudos