Musicbot: Issue running bot on my Pi

Created on 30 Nov 2016  路  7Comments  路  Source: Just-Some-Bots/MusicBot

So yesterday I followed this guide to setting up this music bot on the pi, and the music bot is able to connect and all, but when it tries to play music, I get this error

[Download] Cached: https://www.youtube.com/watch?v=FNOJf-78WpU
Task exception was never retrieved
future: <Task finished coro=<MusicPlayer._play() done, defined at /home/pi/MusicBot/musicbot/player.py:221> exception=ClientException('ffmpeg/avconv was not found in your PATH environment variable',)>
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/site-packages/discord/voice_client.py", line 427, in create_ffmpeg_player
    p = subprocess.Popen(args, stdin=stdin, stdout=subprocess.PIPE, stderr=stderr)
  File "/usr/local/lib/python3.5/subprocess.py", line 950, in __init__
    restore_signals, start_new_session)
  File "/usr/local/lib/python3.5/subprocess.py", line 1540, in _execute_child
    raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'ffmpeg'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(value)
  File "/home/pi/MusicBot/musicbot/player.py", line 256, in _play
    after=lambda: self.loop.call_soon_threadsafe(self._playback_finished)
  File "/usr/local/lib/python3.5/site-packages/discord/voice_client.py", line 430, in create_ffmpeg_player
    raise ClientException('ffmpeg/avconv was not found in your PATH environment variable') from e
discord.errors.ClientException: ffmpeg/avconv was not found in your PATH environment variable

I tried reinstalling FFmpeg according to the guide, and then did some online research and installed libav, but to no avail, what do?

can't repro

All 7 comments

I had the problem too, but with the audio_cache folder.
After I set the read-, write- and execute-permissions for everyone with the 'chmod'-command my problem was solved. I hope that was helpful.

ffmpeg is not installed or is not properly linked

See the installation guide: https://github.com/Just-Some-Bots/MusicBot/wiki/Guide-for-Raspbian#1d-ffmpeg

If that doesn't work, see: https://github.com/Just-Some-Bots/MusicBot/wiki/FAQ#os-x---warningffmpeg-3xx-already-installed-its-just-not-linked

Same issue for me here!

I've re-installed FFMpeg with the instructions provided 3 times now and still have this issue.

@Matt - the link you provided was for OSX with Homebrew. Not for the Pi :-) please let me know if this is still doable on the Pi (not too knowledgable about homebrew).

After Hours of digging
Fix broken package

sudo apt-get install -f

Add the following lines to /etc/apt/sources.list

nano /etc/apt/sources.list

deb http://www.deb-multimedia.org jessie main non-free

deb-src http://www.deb-multimedia.org jessie main non-free

Update:

apt-get update

Add the key

apt-get install deb-multimedia-keyring

update

apt-get update

Remove ffmpeg Debian packge

apt-get remove ffmpeg

As root Install library packages and build tools:

apt-get install build-essential libmp3lame-dev libvorbis-dev libtheora-dev libspeex-dev yasm pkg-config libfaac-dev libopenjpeg-dev libx264-dev

Download the latest ffmpeg from here

wget https://ffmpeg.org/releases/ffmpeg-3.0.2.tar.bz2

Extract it

tar xvjf ffmpeg-3.0.2.tar.bz2

Move into the directory

cd ffmpeg-3.0.2

Configure, build and install:

./configure --enable-gpl --enable-postproc --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libx264 --enable-libspeex --enable-shared --enable-pthreads --enable-libopenjpeg --enable-libfaac --enable-nonfree

make -j 16

sudo make install

All worked dandy until I got to the 'make' stage. Got this error at the very end.

/usr/bin/ld: /usr/local/lib/libx264.a(common.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libx264.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
library.mak:111: recipe for target 'libavcodec/libavcodec.so.57' failed
make: *** [libavcodec/libavcodec.so.57] Error 1
make: *** Waiting for unfinished jobs....

Pi can be fixed! Please follow the official guide but do not install python 3.5.

I also had al lot of issues on my pi3.
Download Python-3.6.1.tar.xz from https://www.python.org/

Unzip the file and keep the folder in home directory.

Open terminal in that directory and perform the following commands:
./configure
make
make test
sudo make install
This will install Python 3.6 but pip3 may not be working.Install necessary modules using:
sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev

Now write the following to re run the installation (EDIT: USE -j4 FOR ALL CORES, WHICH IS ACTUALLY JUST 50% CPU):
sudo make
sudo make install

Now this, even if its again... (If pip3 is not working try pip)
sudo pip3 install numpy
sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev

If not working, do not uninstall a thing but follow the ubuntu 16 guide.

Then try some of my codes again.

I do not have a really good guide because i tried installing the bot and it tooks more than 3 days. Some of these codes fixed it for me. Running 3 bots using python3.6

If this is still an issue in the latest version, please open a new issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ayeitzjeter picture ayeitzjeter  路  8Comments

SylveonBottle picture SylveonBottle  路  5Comments

riggers-logan-1229 picture riggers-logan-1229  路  6Comments

monstermatt2 picture monstermatt2  路  4Comments

neeleythere picture neeleythere  路  3Comments