CODEDRAGON ㆍDevelopment/Python
오류메시지
google.auth.exceptions.DefaultCredentialsError: Could not automatically determine credentials.
raise exceptions.DefaultCredentialsError(_HELP_MESSAGE) google.auth.exceptions.DefaultCredentialsError: Could not automatically determine credentials. Please set GOOGLE_APPLICATION_CREDENTIALS or explicitly create credentials and re-run the application. For more information, please see https://cloud.google.com/docs/authentication/getting-started |
Cloud Vision API has not been used in project xxxx before or it is disabled.
Traceback (most recent call last): File "C:\Python\Python36\lib\site-packages\google\api_core\grpc_helpers.py", line 57, in error_remapped_callable return callable_(*args, **kwargs) File "C:\Python\Python36\lib\site-packages\grpc\_channel.py", line 500, in __call__ return _end_unary_response_blocking(state, call, False, None) File "C:\Python\Python36\lib\site-packages\grpc\_channel.py", line 434, in _end_unary_response_blocking raise _Rendezvous(state, None, None, deadline) grpc._channel._Rendezvous: <_Rendezvous of RPC that terminated with (StatusCode.PERMISSION_DENIED, Cloud Vision API has not been used in project 336460447684 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/vision.googleapis.com/overview?project=3364460447684 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.)>
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "ex01.py", line 62, in <module> run_quickstart() File "ex01.py", line 53, in run_quickstart response = client.label_detection(image=image) File "C:\Python\Python36\lib\site-packages\google\cloud\vision_helpers\decorators.py", line 101, in inner response = self.annotate_image(request, retry=retry, timeout=timeout) File "C:\Python\Python36\lib\site-packages\google\cloud\vision_helpers\__init__.py", line 72, in annotate_image r = self.batch_annotate_images([request], retry=retry, timeout=timeout) File "C:\Python\Python36\lib\site-packages\google\cloud\vision_v1\gapic\image_annotator_client.py", line 274, in batch_annotate_images request, retry=retry, timeout=timeout, metadata=metadata File "C:\Python\Python36\lib\site-packages\google\api_core\gapic_v1\method.py", line 143, in __call__ return wrapped_func(*args, **kwargs) File "C:\Python\Python36\lib\site-packages\google\api_core\grpc_helpers.py", line 59, in error_remapped_callable six.raise_from(exceptions.from_grpc_error(exc), exc) File "<string>", line 3, in raise_from google.api_core.exceptions.PermissionDenied: 403 Cloud Vision API has not been used in project 336460447684 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/vision.googleapis.com/overview?project=3364460447684 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry. |
해결방법 1
GOOGLE_APPLICATION_CREDENTIALS 환경변수 등록하시기 바랍니다.
아래 링크 참조하여 해결하세요.
https://codedragon.tistory.com/9406
해결방법 2
Cloud Vision API를 활성화했는지 확인하시기 바랍니다.
아래 링크 참조하여 해결하세요.
https://codedragon.tistory.com/9362
해결방법 3
Google에서 인증 받은 키가 활성화되는데 시간이 걸릴 수 있습니다.
잠시 후 다시 시도해 보세요.
'Development > Python' 카테고리의 다른 글
for문에서 사용할 수 있는 자료형 (0) | 2019.10.03 |
---|---|
IndentationError: unexpected indent (0) | 2019.10.02 |
GOOGLE_APPLICATION_CREDENTIALS 환경변수 등록하기 (0) | 2019.09.28 |
들여쓰기(indent), 들여쓰기와 제어문 (0) | 2019.09.28 |
numpy 배열 저장하고 읽기 (0) | 2019.09.25 |