使用Python辅助ArcGIS出图-错误排查

目录

1 中文问题

2 ArcPy 模块找不到


1 中文问题

Unicode equal comparison failed to convert both arguments to Unicode - interpreting

 UnicodeEncodeError: 'ascii' codec can't encode characters in position 3-6: ordinal not in range(128) 

import sys
reload(sys)
sys.setdefaultencoding('utf8')

2 ArcPy 模块找不到

import sys
## 添加环境变量 指向ArcPy包的位置
sys.path.append(r'D:\SoftwareHome\ESRI\ArcGIS\Desktop10.2\bin')
sys.path.append(r'D:\SoftwareHome\ESRI\ArcGIS\Server\arcpy')

 

你可能感兴趣的:(Python)