title: AudioSegment unable to find ffmepg and ffprobe
body: <p>I am attempting to load an mp3 file in jupyter notebooks using AudioSegment in python. I have already tried following the instructions from <a href="https://stackoverflow.com/questions/57350259/filenotfounderror-errno-2-no-such-file-or-directory-ffprobe-ffprobe">this</a> link and <a href="https://stackoverflow.com/questions/51219531/pydub-unable-to-locate-ffprobe">this</a> link but I am still running into the following problems. Here is my code and the corresponding errors:</p>
  <pre><code>import sys
  path_to_ffmpeg = &quot;/usr/local/bin/ffmpeg&quot;
  path_to_ffprobe = &quot;/usr/local/bin/ffprobe&quot;
  sys.path.append(path_to_ffmpeg)
  sys.path.append(path_to_ffprobe)
  
  from pydub import AudioSegment
  AudioSegment.converter = &quot;/usr/local/bin/ffmpeg&quot;
  AudioSegment.ffmpeg = &quot;/usr/local/bin/ffmpeg&quot;
  AudioSegment.ffprobe = &quot;/usr/local/bin/ffprobe&quot;
  from ffprobe import FFProbe
  </code></pre>
  <p>Trying to import AudioSegment gives this error:</p>
  <pre><code>/usr/local/lib/python3.9/site-packages/pydub/utils.py:170: RuntimeWarning: Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work
    warn(&quot;Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work&quot;, RuntimeWarning)
  </code></pre>
  <pre><code>filename = &quot;file.mp3&quot;
  audiofile = AudioSegment.from_file(filename, &quot;mp3&quot;)
  audiolen = audiofile.duration_seconds #in seconds
  </code></pre>
  <p>Trying to load the audio file gives this erorr:</p>
  <pre><code>/usr/local/lib/python3.9/site-packages/pydub/utils.py:198: RuntimeWarning: Couldn't find ffprobe or avprobe - defaulting to ffprobe, but may not work
    warn(&quot;Couldn't find ffprobe or avprobe - defaulting to ffprobe, but may not work&quot;, RuntimeWarning)
  </code></pre>
  <pre><code>PermissionError                           Traceback (most recent call last)
  Input In [4], in &lt;cell line: 2&gt;()
        1 filename = &quot;Y2Mate.is - Teen stress from a teen perspective  Michaela Horn  TEDxNaperville-FhG-VoRtkKY-128k-1647187680543.mp3&quot;
  ----&gt; 2 audiofile = AudioSegment.from_file(filename, &quot;mp3&quot;)
        3 audiolen = audiofile.duration_seconds
  
  File /usr/local/lib/python3.9/site-packages/pydub/audio_segment.py:728, in AudioSegment.from_file(cls, file, format, codec, parameters, start_second, duration, **kwargs)
      726     info = None
      727 else:
  --&gt; 728     info = mediainfo_json(orig_file, read_ahead_limit=read_ahead_limit)
      729 if info:
      730     audio_streams = [x for x in info['streams']
      731                      if x['codec_type'] == 'audio']
  
  File /usr/local/lib/python3.9/site-packages/pydub/utils.py:274, in mediainfo_json(filepath, read_ahead_limit)
      271         file.close()
      273 command = [prober, '-of', 'json'] + command_args
  --&gt; 274 res = Popen(command, stdin=stdin_parameter, stdout=PIPE, stderr=PIPE)
      275 output, stderr = res.communicate(input=stdin_data)
      276 output = output.decode(&quot;utf-8&quot;, 'ignore')
  
  File /usr/local/Cellar/python@3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py:951, in Popen.__init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, user, group, extra_groups, encoding, errors, text, umask)
      947         if self.text_mode:
      948             self.stderr = io.TextIOWrapper(self.stderr,
      949                     encoding=encoding, errors=errors)
  --&gt; 951     self._execute_child(args, executable, preexec_fn, close_fds,
      952                         pass_fds, cwd, env,
      953                         startupinfo, creationflags, shell,
      954                         p2cread, p2cwrite,
      955                         c2pread, c2pwrite,
      956                         errread, errwrite,
      957                         restore_signals,
      958                         gid, gids, uid, umask,
      959                         start_new_session)
      960 except:
      961     # Cleanup if the child failed starting.
      962     for f in filter(None, (self.stdin, self.stdout, self.stderr)):
  
  File /usr/local/Cellar/python@3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py:1821, in Popen._execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, restore_signals, gid, gids, uid, umask, start_new_session)
     1819     if errno_num != 0:
     1820         err_msg = os.strerror(errno_num)
  -&gt; 1821     raise child_exception_type(errno_num, err_msg, err_filename)
     1822 raise child_exception_type(err_msg)
  
  PermissionError: [Errno 13] Permission denied: 'ffprobe'
  </code></pre>
  <p>I am unsure how to troubleshoot this further. I am running on macOS Big Sur Version 11.1. Would really appreciate some help.</p>