snipsco / snipsmanager

The Snips Assistant Manager
MIT License
16 stars 16 forks source link

No module named mixer #35

Closed tschmidty69 closed 6 years ago

tschmidty69 commented 6 years ago

Raspbian fresh install, installed snipsmanager via pip method

Exception in thread Thread-27:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/local/lib/python2.7/dist-packages/snipsmanagercore-0.1.7.0.0-py2.7.egg/snipsmanagercore/audio_player.py", line 18, in play
    pygame.mixer.init()
  File "/usr/local/lib/python2.7/dist-packages/pygame-1.9.3-py2.7-linux-armv7l.egg/pygame/__init__.py", line 105, in __getattr__
    raise NotImplementedError(MissingPygameModule)
NotImplementedError: mixer module not available
(ImportError: No module named mixer)
anthonyray commented 6 years ago

Hi ! When installing from pip, you need to install additional dependencies :

sudo apt-get install python-pip libsdl-mixer1.2 libusb-1.0 \
    python-pyaudio libsdl1.2-dev cython cython3 libudev-dev \
    python-dev libsdl-image1.2-dev libsdl-mixer1.2-dev \
    libsdl-ttf2.0-dev libsmpeg-dev python-numpy libportmidi-dev \
    libswscale-dev libavformat-dev libavcodec-dev \
    portaudio19-dev nodejs build-essential -y

Here, you are missing a dependency from PyGame.

Cheers ! ✌🏾

tschmidty69 commented 6 years ago

Thing is I had installed those as well as apt install pygame. A previous install I did not. This is the pip install fwiw.

tschmidty69 commented 6 years ago

Figured it out, it was the pip install of pygame that was broken and took precendence even when I reinstalled pygame. So this fixed it.

sudo pip uninstall pygame
sudo apt install --reinstall pygame

FWIW, you should consolidate the pip and apt since they are different versions and it's a bit wonky.