cshore12
asked on
Why do I get a string argument error when calling a package class located in another folder?
I have written a Python 2.5.6 (ESRI install) calling routine that is located at ..fc_main\Calls (see attachment 1). My called package (attachment 2) is located at ..fc_main\Classes. When I run the calling routine in IDLE version 2.6.5, I get the following error message on the last line:
Traceback (most recent call last):
File "C:\Projects\Front Counter\fc_main\Calls\Tile Call.py", line 8, in <module>
VisibleCheck.CheckOnOffLay ers("Front Counter Data", "Parcels", "False")
TypeError: unbound method CheckOnOffLayers() must be called with VisibleCheck instance as first argument (got str instance instead).
Can you explain why the method is unbound, and why I'm getting this message?
Thanks in advance. TileCall.py MCPIClasses.py
Traceback (most recent call last):
File "C:\Projects\Front Counter\fc_main\Calls\Tile
VisibleCheck.CheckOnOffLay
TypeError: unbound method CheckOnOffLayers() must be called with VisibleCheck instance as first argument (got str instance instead).
Can you explain why the method is unbound, and why I'm getting this message?
Thanks in advance. TileCall.py MCPIClasses.py
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I'm also finding that the importing the arcpy module can be very touchy. I added the appropriate paths to the path and PYTHONPATH system variables, and today the import (obviously) is working OK. Let's hope it will stick.