7

Running almost every code from OpenAi gym in spyder by Anaconda (for instance this code: https://gym.openai.com/evaluations/eval_y5dnhk0ZSMqlqJKBz5vJQw ) I run into the following error message:

DependencyNotInstalled: Found neither the ffmpeg nor avconv executables. On OS X, you can install ffmpeg via 'brew install ffmpeg'. On most Ubuntu variants, 'sudo apt-get install ffmpeg' should do it. On Ubuntu 14.04, however, you'll need to install avconv with 'sudo apt-get install libav-tools'.

However when I type brew install ffmpeg in terminal, I get Warning: ffmpeg-3.2 already installed and nothing happens.

Any ideas on how to fix this error?

Massyanya
  • 2,844
  • 8
  • 28
  • 37

2 Answers2

19

You need to install a copy of ffmpeg that can be recognized by Anaconda. Please run this command in a terminal to do that

conda install -c conda-forge ffmpeg
Carlos Cordoba
  • 33,273
  • 10
  • 95
  • 124
1

Simply download and install ffmpeg and then add to path. After restarting the Jupyter notebook server, it worked for me.

See full instructions here: http://blog.gregzaal.com/how-to-install-ffmpeg-on-windows/

stefanbschneider
  • 5,460
  • 8
  • 50
  • 88
  • For me, when doing this, the error disappears but I get an 1kb sized video file that won't play using VLC. Any tips or tricks? – Stefan Jan 13 '21 at 16:39
  • 1
    There was a bug in the OpenAI library (see here https://github.com/openai/gym/issues/1925 ). I fixed it manually and now it runs like a charm. This answer works for me. – Stefan Jan 14 '21 at 08:52