Upsonic / gpt-computer-assistant

Intelligence development framework in python for your product like Apple Intelligence
https://GCA.dev
MIT License
5.21k stars 490 forks source link

PortAudio library not found #22

Open olives-2 opened 4 months ago

olives-2 commented 4 months ago

When launching computerassistant, I get this error :

Traceback (most recent call last):
  File "/home/molives/.local/bin/computerassistant", line 8, in <module>
    sys.exit(start())
  File "/home/molives/.local/lib/python3.10/site-packages/gpt_computer_assistant/start.py", line 19, in start
    from .gpt_computer_assistant import QApplication, MainWindow, sys
  File "/home/molives/.local/lib/python3.10/site-packages/gpt_computer_assistant/gpt_computer_assistant.py", line 8, in <module>
    from .gui.button import *
  File "/home/molives/.local/lib/python3.10/site-packages/gpt_computer_assistant/gui/button.py", line 4, in <module>
    from ..audio.record import *
  File "/home/molives/.local/lib/python3.10/site-packages/gpt_computer_assistant/audio/__init__.py", line 1, in <module>
    from .record import *
  File "/home/molives/.local/lib/python3.10/site-packages/gpt_computer_assistant/audio/record.py", line 4, in <module>
    import sounddevice as sd
  File "/home/molives/.local/lib/python3.10/site-packages/sounddevice.py", line 71, in <module>
    raise OSError('PortAudio library not found')
OSError: PortAudio library not found

I fixed it by installing the libportaudio2 package in Ubuntu 22.04. I think it would be a good idea to either install it from pip (I don't even know if this is possible) or to list it as a necessary package for Ubuntu.

ChoksiJay commented 4 months ago

The error message you are encountering indicates that the sounddevice module cannot find the PortAudio library, which it relies on for audio input/output operations. To resolve this issue, you need to install the PortAudio library and ensure that your system can access it.

Here are the steps to install PortAudio on different operating systems:

Ubuntu/Debian:

  1. Update the package list:
  1. Install the PortAudio library and development files:
  1. Install sounddevice Python package:
  1. Install the PortAudio library and development files:
  1. Install sounddevice Python package:
  1. Install PortAudio using Homebrew:

If you don't have Homebrew installed, follow the instructions on Homebrew's website to install it.

  1. Install sounddevice Python package:

Windows

  1. Install PortAudio

Download and install the PortAudio library from the official website: PortAudio.. Alternatively, you can use a package manager like choco (Chocolatey) to install PortAudio if it's available.

  1. Install sounddevice Python package:
olives-2 commented 4 months ago

Thank you, but I said I solved my problem by installing the mentioned apt package. However, I just noticed the sounddevice dependency is already listed in the requirements.txt file, but having this dependency installed didn't do anything. I had to install the .deb package from the Ubuntu repositories. We should either find a way to make PortAudio work from the pip dependency, or explicitly indicate in the documentation that the lib needs to be installed from the repositories for Ubuntu (maybe other distros as well, I didn't try it)

steve3p0 commented 5 days ago

I followed the above steps and I'm still getting the same errors.