无法通过python请求调用Azure认知服务计算机视觉OCR API

2024-09-28 22:04:51 发布

您现在位置:Python中文网/ 问答频道 /正文

当我从here执行确切的代码时,我得到了这些错误的列表:

gaierror: [Errno -3] Temporary failure in name resolution

NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x7f193b2d9048>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution

MaxRetryError: HTTPSConnectionPool(host='mike-test.cognitiveservices.azure.com', port=443): Max retries exceeded with url: /vision/v2.1/ocr/?language=en&detectOrientation=false (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f193b2d9048>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))

ConnectionError: HTTPSConnectionPool(host='mike-test.cognitiveservices.azure.com', port=443): Max retries exceeded with url: /vision/v2.1/ocr/?language=en&detectOrientation=false (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f193b2d9048>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))

这是我执行时的错误列表:

response = requests.post(ocr_url, headers=headers, params=params, data=image_data)

请求是从邮递员发出的,但是当我从python请求尝试时,它给出了这个错误


Tags: tonameinfailureobject错误connectionat