Chatterbox-TTS-Server icon indicating copy to clipboard operation
Chatterbox-TTS-Server copied to clipboard

Getting an ImportError: cannot import name 'builder' from 'google.protobuf.internal'

Open theEpicjosh opened this issue 8 months ago • 1 comments

Hello, I have gotten the Chatterbox-TTS installed on my system using the start.bat file as I am on Windows most of the time. However, after installation, the program seems to be at a standstill after about 15 minutes of waiting.

Here are the logs of what came with it.

C:\Users\[username]\Chatterbox-TTS-Server>start.bat

============================================================
   Chatterbox TTS Server - Launcher
============================================================

Checking for Python installation...

[OK] Found Python 3.14.0 (python3)

Verifying Python version...
[OK] Python 3.14 meets requirements (3.10+)

============================================================
Starting Chatterbox TTS Server...
============================================================

Using: python3


============================================================
   Chatterbox TTS Server - Launcher
============================================================


[1/6] Checking Python installation...
      ✓ Python 3.14.0 detected
      ✓ Using existing portable Python 3.10.11

[2/6] Setting up environment...
      → Project directory: C:\Users\[username]\Chatterbox-TTS-Server
      → Python environment: C:\Users\[username]\Chatterbox-TTS-Server\python_embedded (portable)

[3/6] Checking existing installation...
      ✓ Found existing NVIDIA GPU (CUDA 12.1) installation

[4/6] Using existing installation...
      ✓ Installation type: NVIDIA GPU (CUDA 12.1)

[5/6] Loading configuration...
      ✓ Server will run on 0.0.0.0:8004

[6/6] Launching Chatterbox TTS Server...
      → Starting server.py...
      → Injected embedded Python into subprocess PATH
      → Waiting for server to start (this may take a few minutes on first run)...
      .Traceback (most recent call last):
  File "C:\Users\[username]\Chatterbox-TTS-Server\server.py", line 62, in <module>
    import engine  # TTS Engine interface
  File "C:\Users\[username]\Chatterbox-TTS-Server\engine.py", line 12, in <module>
    from chatterbox.tts import ChatterboxTTS  # Main TTS engine class
  File "C:\Users\[username]\Chatterbox-TTS-Server\python_embedded\Lib\site-packages\chatterbox\__init__.py", line 9, in <module>
    from .tts import ChatterboxTTS
  File "C:\Users\[username]\Chatterbox-TTS-Server\python_embedded\Lib\site-packages\chatterbox\tts.py", line 12, in <module>
    from .models.s3tokenizer import S3_SR, drop_invalid_tokens
  File "C:\Users\[username]\Chatterbox-TTS-Server\python_embedded\Lib\site-packages\chatterbox\models\s3tokenizer\__init__.py", line 1, in <module>
    from .s3tokenizer import (
  File "C:\Users\[username]\Chatterbox-TTS-Server\python_embedded\Lib\site-packages\chatterbox\models\s3tokenizer\s3tokenizer.py", line 7, in <module>
    from s3tokenizer.utils import padding
  File "C:\Users\[username]\Chatterbox-TTS-Server\python_embedded\Lib\site-packages\s3tokenizer\__init__.py", line 27, in <module>
    from s3tokenizer.model_v2 import S3TokenizerV2
  File "C:\Users\[username]\Chatterbox-TTS-Server\python_embedded\Lib\site-packages\s3tokenizer\model_v2.py", line 21, in <module>
    from s3tokenizer.model import Conv1d, LayerNorm, Linear, MultiHeadAttention
  File "C:\Users\[username]\Chatterbox-TTS-Server\python_embedded\Lib\site-packages\s3tokenizer\model.py", line 28, in <module>
    from .utils import make_non_pad_mask, mask_to_bias, onnx2torch, merge_tokenized_segments
  File "C:\Users\[username]\Chatterbox-TTS-Server\python_embedded\Lib\site-packages\s3tokenizer\utils.py", line 25, in <module>
    import onnx
  File "C:\Users\[username]\Chatterbox-TTS-Server\python_embedded\Lib\site-packages\onnx\__init__.py", line 78, in <module>
    from onnx.external_data_helper import (
  File "C:\Users\[username]\Chatterbox-TTS-Server\python_embedded\Lib\site-packages\onnx\external_data_helper.py", line 12, in <module>
    from onnx.onnx_pb import AttributeProto, GraphProto, ModelProto, TensorProto
  File "C:\Users\[username]\Chatterbox-TTS-Server\python_embedded\Lib\site-packages\onnx\onnx_pb.py", line 4, in <module>
    from .onnx_ml_pb2 import *  # noqa
  File "C:\Users\[username]\Chatterbox-TTS-Server\python_embedded\Lib\site-packages\onnx\onnx_ml_pb2.py", line 5, in <module>
    from google.protobuf.internal import builder as _builder
ImportError: cannot import name 'builder' from 'google.protobuf.internal' (C:\Users\[username]\Chatterbox-TTS-Server\python_embedded\lib\site-packages\google\protobuf\internal\__init__.py)
....--

If you're curious, running start.py runs the same result, but I installed the program using the batch script. Is there anything I can do to fix this? Would I need to reinstall this program via the python script instead? Maybe I would have to redirect this program to my PATH?

theEpicjosh avatar Mar 26 '26 23:03 theEpicjosh

This was a bug in the installer. During setup, pip installs descript-audiotools which pulls in an old protobuf<3.20. The installer then tries to upgrade protobuf, but on some pip versions (like the one bundled with Python 3.14) the upgrade fails silently because pip's resolver blocks it.

Fixed in 14b76c0 — the protobuf upgrade now uses --no-deps --force-reinstall to bypass the resolver, and checks the return value.

To fix your existing install, run this in the project folder:

python_embedded\Scripts\pip.exe install --no-deps --force-reinstall "protobuf>=4.25.0"

Or delete python_embedded and re-run start.bat for a fresh install.

devnen avatar Mar 28 '26 07:03 devnen