0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

ImportError: cannot import name 'texttospeech_v1' from 'google.cloud' (unknown location)

Posted at

おはようございます。朝からAnacondaを再インストールしていると、Google Text-To-Speechのコードが動かなくなり、困りました。

Windows11 > Anaconda > Jupyter Notebook/Lab で下のエラーメッセージ出たときのお直し忘備録を記載しておきます。

ImportError: cannot import name 'texttospeech_v1' from 'google.cloud' (unknown location)

Python
pip install google-cloud-texttospeech
Python
def explicit():
    from google.cloud import storage

    # Explicitly use service account credentials by specifying the private key
    # file.
    storage_client = storage.Client.from_service_account_json(
        'service_account.json')

    # Make an authenticated API request
    buckets = list(storage_client.list_buckets())
    print(buckets)

以上です。。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?