[ Python Error ] ImportError: cannot import name 'enums' from 'google.cloud.speech'

2021. 12. 12. 00:42·Error code 모음/4. Python errors
반응형

 

 

 

 

1.  원인


google.cloud 라이브러리에서는 이제 더이상

enum, type 을 사용하지 않는다.

즉 아래의 라이브러리들을 사용하지 않는다는 것이다.

from google.cloud.speech import enum
from google.cloud.speech import types

 

 

 

2.수정방법


일전에 해당부분에서 에러가 많이 나서 

위 enum, tyoes  라이브버리들을 없애고, 모두 speech 라이브러리로 통일했다.

from google.cloud import speech

 

아래와 같이 사용하면 된다

 

## before
audio = speech.types.RecognitionAudio(uri=gcs_uri)
encoding = speech.enum.RecognitionConfig.AudioEncoding.ENCODING_UNSPECIFIED


## after
audio = speech.RecognitionAudio(uri=gcs_uri)
encoding = speech.RecognitionConfig.AudioEncoding.ENCODING_UNSPECIFIED

 

반응형
저작자표시 비영리 변경금지 (새창열림)

'Error code 모음 > 4. Python errors' 카테고리의 다른 글

[ Python Error ] dtypewarning columns have mixed types.specify dtype option on import or set low_memory=false  (0) 2022.06.28
[Python Error] Excel does not support datetimes with timezones. Please ensure that datetimes are timezone unaware before writing to Excel.  (0) 2021.12.01
[ Python Error ] 'datetime' has no 'fromtimestamp'  (2) 2021.11.04
[Python Error] 'tqdm_notebook' object has no attribute 'disp'  (0) 2021.11.03
[Python] PIP Install: Cannot combine --user and --target 에러  (0) 2021.07.08
'Error code 모음/4. Python errors' 카테고리의 다른 글
  • [ Python Error ] dtypewarning columns have mixed types.specify dtype option on import or set low_memory=false
  • [Python Error] Excel does not support datetimes with timezones. Please ensure that datetimes are timezone unaware before writing to Excel.
  • [ Python Error ] 'datetime' has no 'fromtimestamp'
  • [Python Error] 'tqdm_notebook' object has no attribute 'disp'
쟈누
쟈누
Ad astra per aspera
    반응형
  • 쟈누
    쟈누의 기록공간
    쟈누
  • 전체
    오늘
    어제
    • 분류 전체보기 (444)
      • AWS (31)
        • Glue (4)
        • S3 (1)
      • 클라우드 (0)
      • Data Engineering (37)
        • GitHub (10)
        • NiFi (11)
        • Spark (10)
        • Snowflake (0)
        • 머신러닝, AI (6)
      • 언어 (118)
        • 데이터 베이스 (42)
        • JAVA (9)
        • Python (34)
        • Java Script (15)
        • Linux (18)
      • 프로젝트, 인강 그리고 책 (30)
        • Spotify Project (7)
        • RASA chatbot Project (9)
        • Naver shopping Project (6)
        • 빅데이터를 지탱하는 기술 (8)
      • OLD (56)
        • IT 용어 사전 (13)
        • Front End (12)
        • Back End (31)
      • Error code 모음 (165)
        • 1. SQL errors (17)
        • 2. Hadoop errors (20)
        • 3. Linux Errors (14)
        • 4. Python errors (33)
        • 5. JAVA, Spring errors (41)
        • 6. Jav Script errors (10)
        • 7. Dev Tools errors (9)
        • 8. Git errors (8)
        • 9. Jenkins Errors (4)
        • 10. airflow Errors (2)
        • 11. Aws errors (7)
      • 개인 (1)
        • 책 (1)
  • 블로그 메뉴

    • 홈
    • 태그
    • 방명록
    • 블로그 관리
    • 글쓰기
  • 링크

  • 공지사항

    • 간단한 블로그 소개
  • 인기 글

  • 태그

    java
    파이썬
    SQL
    Python
    자바
    리눅스
    AWS
    node
    Spring
    NiFi
    python error
    에러
    설치
    error
    install
    Git
    linux
    MySQL
    API
    json
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.3
쟈누
[ Python Error ] ImportError: cannot import name 'enums' from 'google.cloud.speech'
상단으로

티스토리툴바