Python 属性错误:';unicode';对象没有属性';图像标识';

Python 属性错误:';unicode';对象没有属性';图像标识';,python,json,python-2.7,Python,Json,Python 2.7,我有这个使用face++服务的图像处理python代码 矿山代码为: import requests import json API_KEY = "***************************" API_SECRET = "**************************" detect = { 'api_key': (None, API_KEY), 'api_secret': (None, API_SECRET), 'image_file': ('i

我有这个使用face++服务的图像处理python代码

矿山代码为:

import requests
import json


API_KEY = "***************************"
API_SECRET = "**************************"

detect = {
    'api_key': (None, API_KEY),
    'api_secret': (None, API_SECRET),
    'image_file': ('image_file.jpg', open('image_file.jpg', 'rb')),
    'return_attributes': (None, 'gender,age'),
}

response = requests.post('https://api-us.faceplusplus.com/facepp/v3/detect', files=detect)

responseData = (response.text)
print(responseData)
print("----------------------------------------------------")
print(responseData.image_id)
上面给出的错误
AttributeError:“unicode”对象没有属性“image id”


因此,当我最后打印图像id时,我得到了这个错误,希望您能解决它。

您应该将响应解析为JSON:

responseData = response.json()