compat.py
Go to the documentation of this file.
1 import os
2 import subprocess
3 import warnings
4 
5 import matplotlib
6 
7 
9  python_version=os.getenv('ROS_PYTHON_VERSION')):
10  if python_version == '2':
11  python = 'python'
12  else:
13  python = 'python{}'.format(python_version)
14  out = subprocess.check_output(
15  ['dpkg', '-L', '{}-matplotlib'.format(python)])
16  if isinstance(out, bytes):
17  out = out.decode('utf-8')
18  matplotlib_filelists = out.split()
19  if os.path.dirname(matplotlib.__file__) in matplotlib_filelists:
20  return True
21  else:
22  warnings.warn(
23  "It looks like you are using pip's matplotlib. "
24  "Apt's matplotlib is recommended.")
25  return False
audio_to_spectrogram.compat.check_matplotlib_version
def check_matplotlib_version(python_version=os.getenv('ROS_PYTHON_VERSION'))
Definition: compat.py:8


audio_to_spectrogram
Author(s):
autogenerated on Sat Feb 22 2025 04:03:22