成功解决TypeError: ‘encoding’ is an invalid keyword argument for this function。

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_41185868/article/details/85471147

解决问题

TypeError: ‘encoding’ is an invalid keyword argument for this function。

解决思路

类型错误:“encoding”是此函数的无效关键字参数,可知版本不同,编码也不一样!

解决方法

import io data_file = io.open("F:\\MyPro\\data.yaml", "r", encoding='utf-8')

猜你喜欢

转载自blog.csdn.net/qq_41185868/article/details/85471147