apeatling / ollama-voice-mac

Mac compatible Ollama Voice
GNU Affero General Public License v3.0
413 stars 44 forks source link

ModuleNotFoundError: No module named 'pyttsx3' #15

Open scott-mackenzie opened 5 months ago

scott-mackenzie commented 5 months ago

Please let me start by saying thank you and I do love the thought put into this concept project. I think this type of project is critical for long term societal protections to ensure LLM Localization empowers people and not only States or major corporations.

The error seems like a simple one but so far working the problem has not resulted in a solution. Any ideas are most welcome!

Below is System information:

`Software:

System Software Overview:

  System Version: macOS 14.4.1 (23E224)
  Kernel Version: Darwin 23.4.0
  Boot Volume: Macintosh HD
  Boot Mode: Normal
  Computer Name: N/A
  User Name: N/A
  Secure Virtual Memory: Enabled
  System Integrity Protection: Enabled
  Time since boot: 25 days, 18 hours, 9 minutes

Hardware:

Hardware Overview:

  Model Name: MacBook Pro
  Model Identifier: Mac14,6
  Model Number: Z179000H4LL/A
  Chip: Apple M2 Max
  Total Number of Cores: 12 (8 performance and 4 efficiency)
  Memory: 96 GB
  System Firmware Version: 10151.101.3
  OS Loader Version: 10151.101.3
  Serial Number (system): N/A
  Hardware UUID: 9A28DB48-8F29-5124-996B-7A6D8507642F
  Provisioning UDID: 00006021-0018690C14F0C01E
  Activation Lock Status: Enabled`

This is a clean install as per the default guidance. As per the other Issue the requirements.txt had to be adjusted to the below to even get as far as an error on the run command "python -v assistant.py" with the applicable section of the failure shown below at point of error:

# extension module '_struct' executed from '/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/lib-dynload/_struct.cpython-39-darwin.so' import '_struct' # <_frozen_importlib_external.ExtensionFileLoader object at 0x105061df0> import 'struct' # <_frozen_importlib_external.SourceFileLoader object at 0x105061a30> import 'wave' # <_frozen_importlib_external.SourceFileLoader object at 0x104ff94f0> Traceback (most recent call last): File "/Users/username/WebstormProjects/ollama-voice-mac/assistant.py", line 5, in <module> import pyttsx3 File "<frozen importlib._bootstrap>", line 1007, in _find_and_load File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked ModuleNotFoundError: No module named 'pyttsx3'

However when I run the below command to check if pyttsx3 is installed it shows that the module is present:

pip install pyttsx3 --break-system-packages --user

Using the variables of "--break-system-packages" and "--user" as I use homebrew.

Has anyone gotten ollama-voice-mac to work on a MacBook m2?

Any ideas on this error / obstacle?

pcrouthers commented 5 months ago

Im getting same issue

BassAzayda commented 4 months ago

try

pip install py3-tts
airtonix commented 3 months ago

oh god please stop telling people to install python packages with pip without first creating a virtualenv.

The amount of broken OSes out there .... T_T

simply using poetry in non package mode will be a huge step forward.

[tool.poetry]
name = "ollama-voice-mac"
version = "0.1.0"
description = ""
authors = ["Some Guy <some.guy@users.noreply.github.com>"]
readme = "README.md"
package-mode = false

[tool.poetry.dependencies]
python = "^3.10"
torch = "2.1.2"
torchvision = "0.16.2"
torchaudio = "2.1.2"
pyttsx3 = "2.90"
blobfile = "2.1.1"
openai = "1.7.0"
Wave = "0.0.2"
PyAudio = "0.2.14"
PyYAML = "6.0.1"
pygame = "2.5.2"
soundfile = "0.12.1"
openai-whisper = {git = "https://github.com/openai/whisper.git", rev = "ba3f3cd54b0e5b8ce1ab3de13e32122d0d5f98ab"}

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
mavek commented 3 months ago

Thanks a million for pointing to poetry as solution - priceless help for those just entering the world of Python.