I tried a lot to solve but finding this issue

requirements.txt
streamlit
SpeechRecognition
pymupdf
python-docx
ibm-watson
requests
fpdf
reportlab
sounddevice
streamlit-audiorecorder
audio-recorder-streamlit

packeges.txt
portaudio19-dev
python3-all-dev

But the issue is
ModuleNotFoundError: This app has encountered an error. The original error message is redacted to prevent data leaks. Full error details have been recorded in the logs (if you’re on Streamlit Cloud, click on ‘Manage app’ in the lower right of your app).

Traceback:

File "/home/adminuser/venv/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/exec_code.py", line 85, in exec_func_with_error_handling
    result = func()
             ^^^^^^File "/home/adminuser/venv/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 576, in code_to_exec
    exec(code, module.__dict__)File "/mount/src/knowledgebridge/app.py", line 91, in <module>
    mic = sr.Microphone()
          ^^^^^^^^^^^^^^^File "/home/adminuser/venv/lib/python3.12/site-packages/speech_recognition/__init__.py", line 80, in __init__
    self.pyaudio_module = self.get_pyaudio()
                          ^^^^^^^^^^^^^^^^^^File "/home/adminuser/venv/lib/python3.12/site-packages/speech_recognition/__init__.py", line 111, in get_pyaudio
    from distutils.version import LooseVersion

Try removing python3-all-dev from packages.txt and reboot the app. Cannot import pyaudio while deploying my app - Community Cloud - Streamlit

If you want to record audio from the microphone, check stefanrmmr/streamlit-audio-recorder: Record Audio from the User’s Microphone in Apps that are Deployed to the Web. (via Browser Media-API, REACT-based, Streamlit Custom Component) (github.com)

Thank you dear, it is working now.

1 Like