一、SyntaxError: invalid character in identifier
报错意思为:标识符中的字符无效
原因:
1.有中文字符,逗号,引号,冒号等
2.在引号内的字符串前后有空格,导致识别不到该关键词。
解决办法:
修改报错位置的标识符即可。
二、TypeError: cannot do slice indexing on RangeIndex with these indexers
三、导出csv文件中文乱码
encoding='utf-8'#不管用时
df.to_csv('data3.csv',index=False,encoding='utf_8_sig')#有用!!!
三、安装包失败
出现报错:
Building wheel for matplotlib (setup.py) … error
ERROR: Command errored out with exit status 1:
原因:python3.9版本没有相应的matplotlib版本
解决办法:指定labelme虚拟环境的python版本,例如项目Requirements要求为Python 3.6
conda create --name=labelme python=3.6
conda activate labelme
pip install labelme