1
votes

I am using the SDK (Python) for Computer Vision published in Mocrosoft Docs (https://docs.microsoft.com/es-es/azure/cognitive-services/computer-vision/quickstarts-sdk/python-sdk).

When I run the code, this error occurs:

Traceback (most recent call last):

File "c:/analyze_image_local.py", line 68, in <module>
    
description_result = computervision_client.describe_image_in_stream(local_image)

  
File "C:\Anaconda3\lib\site-packages\azure\cognitiveservices\vision\computervision\operations\_computer_vision_client_operations.py", line 1202, in describe_image_in_stream

request = self._client.post(url, query_parameters, header_parameters, body_content)
  

File "C:\Anaconda3\lib\site-packages\msrest\service_client.py", line 193, in post
    
request = self._request('POST', url, params, headers, content, form_content)
  

File "C:\Anaconda3\lib\site-packages\msrest\service_client.py", line 108, in _request
    
request = ClientRequest(method, self.format_url(url))
  

File "C:\Anaconda3\lib\site-packages\msrest\service_client.py", line 155, in format_url
    
base = self.config.base_url.format(**kwargs).rstrip('/')

KeyError: 'Endpoint'
2
What parameters have you used? (don't give us your key, but the url, params...)Nicolas R
Nicolas, I set the endpoint as an environmental variable using the command setx COMPUTER_VISION_ENDPOINT 'westus2.api.cognitive.microsoft.com'ACS

2 Answers

1
votes

I rather used the REST API method (https://docs.microsoft.com/en-us/azure/cognitive-services/computer-vision/quickstarts/python-disk)

However, it can be useful to complete the endpoint using this command line: analyze_url = endpoint + "vision/v2.1/analyze"

0
votes

Simply run the following command to reinstall customvision SDK worked for me.

pip uninstall azure-cognitiveservices-vision-customvision
pip install azure-cognitiveservices-vision-customvision