#2914 ModuleNotFoundError: No module named 'azure'

156.229* Posted at: 20 hours ago 👁17

Traceback (most recent call last):
File "videotrans/mainwin/_main_win.py", line 332, in _set_default

from videotrans import tts

File "pyimod02_importers.py", line 457, in exec_module
File "videotrans/tts/__init__.py", line 9, in

from videotrans.tts._azuretts import AzureTTS

File "pyimod02_importers.py", line 457, in exec_module
File "videotrans/tts/_azuretts.py", line 5, in

import azure.cognitiveservices.speech as speechsdk

ModuleNotFoundError: No module named 'azure'


=
system:macOS-15.7.3-arm64-arm-64bit-Mach-O
version:v3.95
frozen:True
language:en
root_dir:/Users/zeguoshuma/Documents/pyVideoTrans/pyvideotrans/dist/pyVideoTrans.app/Contents/Resources

1 Replies

This error occurs because the required azure-cognitiveservices-speech Python package is missing in your macOS environment. The pre-packaged version for Windows includes all dependencies, but on macOS, you need to install the missing packages manually.

Solution Steps:

  1. Open Terminal.
  2. Navigate to the pyVideoTrans source code directory. If you installed via source, go to the folder where you cloned the repository (e.g., cd ~/pyvideotrans). If you are using a packaged .app, you likely need to install the package globally or in a virtual environment for the application to access it.
  3. Install the missing Azure package using pip or uv:

    • If you used uv to set up the project, run: uv add azure-cognitiveservices-speech
    • Alternatively, using pip: pip install azure-cognitiveservices-speech
  4. Restart the pyVideoTrans application.

Note for macOS/Linux Users: The software must be run from the source code installation method, not from a pre-packaged .app intended for Windows. Ensure you have followed the correct setup steps for macOS:

  • Install FFmpeg (e.g., brew install ffmpeg).
  • Install Python 3.10+ and uv.
  • Clone the repository and install dependencies with uv sync.
  • Run the software with uv run sp.py.

If the error persists after installing the package, the application might be running from a different Python environment. Make sure you are launching it from the terminal within the project's virtual environment.

Please refer to the relevant documentation:

Post Your Reply
Open source and free maintenance is not easy. If this project is helpful to you, please consider making a small donation to help the project continue to maintain and update.

Related resource