问题背景
在python2中安装了labelme,可以正常运行,然后又再python3中安装了labelme。后来python2中的labelme不能运行,python3中的labelme可以运行。
具体问题
UnicodeEncodeError: ‘ascii’ codec can’t encode characters in position 0-3: ordinal not in range(128)
解决方法
在文件开头添加(我的文件在C:\Anaconda2\envs\labelme\Lib\site-packages\labelme\app.py中):
import sys
reload(sys)
sys.setdefaultencoding("utf8")