Python2中存在该方法,Python3中已经取消了。 解决方案: 使用'PyBytes_AsString'代替试试看。 转载于:https://www.cnblogs.com/shirley-bhu/p/10657340.html