googleapis / python-speech

This library has moved to https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-speech
Apache License 2.0
358 stars 209 forks source link

/lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.33' not found #315

Closed Psychokiller1888 closed 1 year ago

Psychokiller1888 commented 2 years ago

Thanks for stopping by to let us know something could be better!

PLEASE READ: If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response.

Please run down the following list and make sure you've tried the usual "quick fixes":

If you are still having issues, please be sure to include as much information as possible:

Environment details

Steps to reproduce

  1. pip install google-cloud-speech
  2. Import the package within a try

Code example

try:
    from google.cloud import speech
except:
    traceback.print_exc()

Stack trace

[ASRManager]                        Starting
Traceback (most recent call last):
  File "/home/pi/ProjectAlice/core/asr/model/GoogleAsr.py", line 36, in <module>
    from google.cloud import speech
  File "/home/pi/ProjectAlice/venv/lib/python3.7/site-packages/google/cloud/speech/__init__.py", line 17, in <module>
    from google.cloud.speech_v1 import SpeechClient
  File "/home/pi/ProjectAlice/venv/lib/python3.7/site-packages/google/cloud/speech_v1/__init__.py", line 17, in <module>
    from .services.speech import SpeechClient
  File "/home/pi/ProjectAlice/venv/lib/python3.7/site-packages/google/cloud/speech_v1/services/speech/__init__.py", line 16, in <module>
    from .client import SpeechClient
  File "/home/pi/ProjectAlice/venv/lib/python3.7/site-packages/google/cloud/speech_v1/services/speech/client.py", line 24, in <module>
    from google.api_core import gapic_v1
  File "/home/pi/ProjectAlice/venv/lib/python3.7/site-packages/google/api_core/gapic_v1/__init__.py", line 16, in <module>
    from google.api_core.gapic_v1 import config
  File "/home/pi/ProjectAlice/venv/lib/python3.7/site-packages/google/api_core/gapic_v1/config.py", line 23, in <module>
    import grpc
  File "/home/pi/ProjectAlice/venv/lib/python3.7/site-packages/grpc/__init__.py", line 22, in <module>
    from grpc import _compression
  File "/home/pi/ProjectAlice/venv/lib/python3.7/site-packages/grpc/_compression.py", line 15, in <module>
    from grpc._cython import cygrpc
ImportError: /lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.33' not found (required by /home/pi/ProjectAlice/venv/lib/python3.7/site-packages/grpc/_cython/cygrpc.cpython-37m-arm-linux-gnueabihf.so)

Making sure to follow these steps will guarantee the quickest resolution possible.

Thanks!

mm3509 commented 2 years ago

I have the same issue on Raspberry Pi with the text-to-speech package, google-cloud-texttospeech==2.3.0. I get this error:

  File "/usr/src/app/speech_synthesis.py", line 9, in <module>
    from google.cloud import texttospeech
  File "/usr/local/lib/python3.7/dist-packages/google/cloud/texttospeech/__init__.py", line 18, in <module>
    from google.cloud.texttospeech_v1.services.text_to_speech.async_client import (
  File "/usr/local/lib/python3.7/dist-packages/google/cloud/texttospeech_v1/__init__.py", line 18, in <module>
    from .services.text_to_speech import TextToSpeechClient
  File "/usr/local/lib/python3.7/dist-packages/google/cloud/texttospeech_v1/services/text_to_speech/__init__.py", line 18, in <module>
    from .client import TextToSpeechClient
  File "/usr/local/lib/python3.7/dist-packages/google/cloud/texttospeech_v1/services/text_to_speech/client.py", line 27, in <module>
    from google.api_core import gapic_v1  # type: ignore
  File "/usr/local/lib/python3.7/dist-packages/google/api_core/gapic_v1/__init__.py", line 18, in <module>
    from google.api_core.gapic_v1 import config
  File "/usr/local/lib/python3.7/dist-packages/google/api_core/gapic_v1/config.py", line 23, in <module>
    import grpc
  File "/usr/local/lib/python3.7/dist-packages/grpc/__init__.py", line 22, in <module>
    from grpc import _compression
  File "/usr/local/lib/python3.7/dist-packages/grpc/_compression.py", line 15, in <module>
    from grpc._cython import cygrpc
ImportError: /lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.33' not found (required by /usr/local/lib/python3.7/dist-packages/grpc/_cython/cygrpc.cpython-37m-arm-linux-gnueabihf.so)

When I replace google-cloud-texttospeech with google-cloud-speech, I get an error because I did not install Rust (and when I install it, I get another error because cargo is missing).

Psychokiller1888 commented 2 years ago

Yep, you have to install Rust as well, same here. Raspi 4? I had to migrate to Microsoft Azure, as there's no way my project can use Google services, many are broken on raspberry distros

mm3509 commented 2 years ago

I have Raspberry Pi Model 3 B+. I tried installing Rust and gave up in the first hell of dependency hell (when I found I needed cargo as well). If I install Rust and Cargo, and all the other dependencies, do you think it would work? Yes, Azure is probably more future-proof, I will probably take the plunge and migrate too.

Psychokiller1888 commented 2 years ago

No it won't, I'm just amazed it's also the case on pi3b+, so that means @google broke everything by addind glibc 2.33 (pi4 with buster ships with 2.28) as minimum dependency. This means, no more google ASR and TTS on any raspberry pi..... Re MS Azure, yes and no, you can't use their SDK on your 3b+ as it requires 64 bits OS, so on a pi 4, with latest OS you could. You can use their REST Api, but it doesn't support intermediate results and no utterance end detect..... I'm testing whatever I can, for my ProjectAlice, and Google was at least one of the good ASR, with speed, precision, intermediate and end detection. I implemented Azure, going to give a shot at Amazon and IBM also, but I know for a fact Amazon doesn't support streaming.......

mm3509 commented 2 years ago

At the moment I only need text-to-speech, not speech-to-text and utterance end detect, so I'll give Amazon a shot. Thanks for the tip!

Psychokiller1888 commented 2 years ago

Oh, if you only need TTS, Amazon Polly is awesome! Just curious for this bug report, are you running bullseye on your pi or buster? 

mm3509 commented 2 years ago

Yes, just checked, and they don't seem to have neural voices in Portuguese. I'll check the pros and cons of these providers. And maybe Google also has a REST API, too.

I'm running buster on the Pi 3B+.

Psychokiller1888 commented 2 years ago

Yes they do :-)

Psychokiller1888 commented 2 years ago

Is there any news @aribray or should all Raspberry Pi users migrate away from Google and start using other services that work such as Amazon or Azure?

mm3509 commented 2 years ago

I succeeded in moving to the REST API. I used code from a lot of different places, as the documentation on this use case is flimsy, and I post it here in case it can help someone:

import base64
import requests

text = "Hello world!"
language = "en-GB"
voice = "en-GB-Wavenet-A"
filepath = "/tmp/audio.wav"

def synthesize(text, language, voice, filepath):
    doc = {
        "input": {
            "text": text,
        },
        "voice": {
            "languageCode": language,
            "name": voice_name
        },
        "audioConfig": {
            "audioEncoding": "LINEAR16",
            "pitch": "0.00",
            "speakingRate": "1.00"
        }
    }

    r = requests.post("https://texttospeech.googleapis.com/v1beta1/text:synthesize?key="+GOOGLE_API_KEY, json=doc)

    content = json.loads(r.content.decode("ascii"))

    binary = base64.b64decode(content["audioContent"])

    # The response's audio_content is binary, and base-64 encoded.
    # Convert with base-64.
    with open(filepath, 'wb') as out:
        # Write the response to the output file.
        out.write(binary)

    log('Audio content written to file "%s".' % filepath)

synthesize(text, language, voice, filepath)
atulep commented 1 year ago

This problem is not specific to client library, but rather a problem with gRPC. I recommend you open bug with gRPC, if this is still an issue.

Seems like others resolved it by using --no-binary option in pip install -- https://stackoverflow.com/questions/71054519/glibc-2-33-not-found-in-raspberry-pi-python