音频处理 windows10下python三方库librosa安装教程

librosa是处理音频库里的opencv,使用python脚本研究音频,先安装三方库librosa。

如下通过清华镜像源安装librosa;

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple librosa

D:\D00_Python3\D00A2_python3.7.3\install>pip install -i https://pypi.tuna.tsinghua.edu.cn/simple librosa
 
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Processing c:\users\administrator\appdata\local\pip\cache\wheels\6e\d3\47\7582e7e63ee9127f4773adeb8dcd8490771c063e2607354ba0\librosa-0.7.2-py3-none-any.whl
Requirement already satisfied: numba>=0.43.0 in d:\d00_python3\d00a2_python3.7.3\install\lib\site-packages (from librosa) (0.50.0)
Requirement already satisfied: joblib>=0.12 in d:\d00_python3\d00a2_python3.7.3\install\lib\site-packages (from librosa) (0.15.1)
Requirement already satisfied: resampy>=0.2.2 in d:\d00_python3\d00a2_python3.7.3\install\lib\site-packages (from librosa) (0.2.2)
Requirement already satisfied: numpy>=1.15.0 in d:\d00_python3\d00a2_python3.7.3\install\lib\site-packages (from librosa) (1.18.5)
Requirement already satisfied: audioread>=2.0.0 in d:\d00_python3\d00a2_python3.7.3\install\lib\site-packages (from librosa) (2.1.8)
Requirement already satisfied: scipy>=1.0.0 in d:\d00_python3\d00a2_python3.7.3\install\lib\site-packages (from librosa) (1.4.1)
Requirement already satisfied: soundfile>=0.9.0 in d:\d00_python3\d00a2_python3.7.3\install\lib\site-packages (from librosa) (0.10.3.post1)
Requirement already satisfied: scikit-learn!=0.19.0,>=0.14.0 in d:\d00_python3\d00a2_python3.7.3\install\lib\site-packages (from librosa) (0.23.1)
Requirement already satisfied: six>=1.3 in d:\d00_python3\d00a2_python3.7.3\install\lib\site-packages (from librosa) (1.15.0)
Requirement already satisfied: decorator>=3.0.0 in d:\d00_python3\d00a2_python3.7.3\install\lib\site-packages (from librosa) (4.4.2)
Requirement already satisfied: setuptools in d:\d00_python3\d00a2_python3.7.3\install\lib\site-packages (from numba>=0.43.0->librosa) (47.1.1)
Requirement already satisfied: llvmlite<0.34,>=0.33.0.dev0 in d:\d00_python3\d00a2_python3.7.3\install\lib\site-packages (from numba>=0.43.0->librosa) (0.33.0)
Requirement already satisfied: cffi>=1.0 in d:\d00_python3\d00a2_python3.7.3\install\lib\site-packages (from soundfile>=0.9.0->librosa) (1.14.0)
Requirement already satisfied: threadpoolctl>=2.0.0 in d:\d00_python3\d00a2_python3.7.3\install\lib\site-packages (from scikit-learn!=0.19.0,>=0.14.0->librosa) (2.1.0)
Requirement already satisfied: pycparser in d:\d00_python3\d00a2_python3.7.3\install\lib\site-packages (from cffi>=1.0->soundfile>=0.9.0->librosa) (2.20)
Installing collected packages: librosa
Successfully installed librosa-0.7.2
 
D:\D00_Python3\D00A2_python3.7.3\install>

pip list查看三方包:

D:\D00_Python3\D00A2_python3.7.3\install>pip list
Package       Version
-------------------- ------------
absl-py       0.9.0
astor        0.8.1
audioread      2.1.8
cffi         1.14.0
decorator      4.4.2
defusedxml      0.6.0
gast         0.3.3
google-pasta     0.2.0
grpcio        1.29.0
h5py         2.10.0
importlib-metadata  1.6.1
joblib        0.15.1
Keras-Applications  1.0.8
Keras-Preprocessing 1.1.2
librosa       0.7.2
llvmlite       0.33.0
Markdown       3.2.2
networkx       2.2
numba        0.50.0
numpy        1.18.5
pip         20.1.1
protobuf       3.12.2
pycparser      2.20
resampy       0.2.2
scikit-learn     0.23.1
scipy        1.4.1
setuptools      47.1.1
six         1.15.0
SoundFile      0.10.3.post1
tensorboard     1.14.0
tensorflow      1.14.0
tensorflow-estimator 1.14.0
termcolor      1.1.0
threadpoolctl    2.1.0
Werkzeug       1.0.1
wheel        0.34.2
wrapt        1.12.1
zipp         3.1.0

D:\D00_Python3\D00A2_python3.7.3\install>

如上

librosa ---- 0.7.2

numba-----0.50.0

下面使用librosa,报的是numba的错误!

D:\D00_Python3\D00A2_python3.7.3\install>python -c "import librosa"
Traceback (most recent call last):
 File "<string>", line 1, in <module>
 File "D:\D00_Python3\D00A2_python3.7.3\install\lib\site-packages\librosa\__init__.py", line 12, in <module>
  from . import core
 File "D:\D00_Python3\D00A2_python3.7.3\install\lib\site-packages\librosa\core\__init__.py", line 125, in <module>
  from .time_frequency import * # pylint: disable=wildcard-import
 File "D:\D00_Python3\D00A2_python3.7.3\install\lib\site-packages\librosa\core\time_frequency.py", line 11, in <module>
  from ..util.exceptions import ParameterError
 File "D:\D00_Python3\D00A2_python3.7.3\install\lib\site-packages\librosa\util\__init__.py", line 77, in <module>
  from .utils import * # pylint: disable=wildcard-import
 File "D:\D00_Python3\D00A2_python3.7.3\install\lib\site-packages\librosa\util\utils.py", line 15, in <module>
  from .decorators import deprecated
 File "D:\D00_Python3\D00A2_python3.7.3\install\lib\site-packages\librosa\util\decorators.py", line 9, in <module>
  from numba.decorators import jit as optional_jit
ModuleNotFoundError: No module named 'numba.decorators'

D:\D00_Python3\D00A2_python3.7.3\install>

解决办法:

卸载numba后,重新安装降版本的numba,安装numba==0.48.0

pip uninstall numba

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple numba==0.48.0

python -c "import librosa;print(librosa.__version__) "

可以看到成功安装了正确可使用的librosa库!

D:\D00_Python3\D00A2_python3.7.3\install>pip uninstall numba
Found existing installation: numba 0.50.0
Uninstalling numba-0.50.0:
 Would remove:
  d:\d00_python3\d00a2_python3.7.3\install\lib\site-packages\numba-0.50.0.dist-info\*
  d:\d00_python3\d00a2_python3.7.3\install\lib\site-packages\numba\*
  d:\d00_python3\d00a2_python3.7.3\install\scripts\numba
  d:\d00_python3\d00a2_python3.7.3\install\scripts\pycc
Proceed (y/n)? y
 Successfully uninstalled numba-0.50.0

D:\D00_Python3\D00A2_python3.7.3\install>pip install -i https://pypi.tuna.tsinghua.edu.cn/simple numba==0.48.0
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting numba==0.48.0
 Downloading https://pypi.tuna.tsinghua.edu.cn/packages/f5/ca/9e47464d388c3372454639d1739fa21605862c8815d53279e1216b5694e1/numba-0.48.0-cp37-cp37m-win_amd64.whl (2.1 MB)|█████████████████████████████▌ | 1.9 MB 2.2 MB/s eta 0:00:01   |██████████████████████████████ | 2.0 MB 2.2 MB/s eta 0:00:01   |██████████████████████████████▌ | 2.0 MB 2.2 MB/s eta 0:00:0   |███████████████████████████████ | 2.0 MB 2.2 MB/s eta 0:00:0   |███████████████████████████████▌| 2.1 MB 2.2 MB/s eta 0:00:    |████████████████████████████████| 2.1 MB 2.2 MB/s
Requirement already satisfied: setuptools in d:\d00_python3\d00a2_python3.7.3\install\lib\site-packages (from numba==0.48.0) (47.1.1)
Requirement already satisfied: numpy>=1.15 in d:\d00_python3\d00a2_python3.7.3\install\lib\site-packages (from numba==0.48.0) (1.18.5)
Collecting llvmlite<0.32.0,>=0.31.0dev0
 Downloading https://pypi.tuna.tsinghua.edu.cn/packages/1d/83/cd2843726a6316e372822e9e42cd0083b6d1d98d89d53880e7e67d5eec68/llvmlite-0.31.0-cp37-cp37m-win_amd64.whl (13.6 MB)
████████████████████████████▌  | 12.1 MB 3.3 MB/s eta 0:00:01   |█████████████████████████████  | 12.5 MB 3.3 MB/s eta 0:00:01   |██████████████████████████████ | 12.9 MB 3.3 MB/s eta 0:00:0   |██████████████████████████████▌ | 13.1 MB 3.3 MB/s eta 0:00:    |████████████████████████████████| 13.6 MB 434 kB/s
Installing collected packages: llvmlite, numba
 Attempting uninstall: llvmlite
  Found existing installation: llvmlite 0.33.0
  Uninstalling llvmlite-0.33.0:
   Successfully uninstalled llvmlite-0.33.0
Successfully installed llvmlite-0.31.0 numba-0.48.0

D:\D00_Python3\D00A2_python3.7.3\install>python -c "import librosa;print(librosa.__version__) "
0.7.2

总结

到此这篇关于音频处理 windows10下python三方库librosa安装教程的文章就介绍到这了,更多相关音频处理python三方库librosa安装内容请搜索我们以前的文章或继续浏览下面的相关文章希望大家以后多多支持我们!

(0)

相关推荐

  • Python中音频处理库pydub的使用教程

    前言 pydub是Python中用户处理音频文件的一个库.本文主要介绍了关于Python音频处理库pydub使用的相关内容,分享出来供大家参考学习,下面来看看详细的介绍: 安装: 1.安装pip工具:sudo apt-get install python-pip 2.安装pydub:sudo pip install pydub 3.pydub依赖于ffmpeg,所以还需要安装ffmpeg,由于Ubunbtu14.04官方源移除了ffmpeg,因此通过ppa源安装: sudo apt-add-re

  • 对python中Librosa的mfcc步骤详解

    1.对语音数据归一化 如16000hz的数据,会将每个点/32768 2.计算窗函数:(*注意librosa中不进行预处理) 3.进行数据扩展填充,他进行的是镜像填充("reflect") 如原数据为 12345 -> 填充为4的,左右各填充4 即:5432123454321 即:5432-12345-4321 4.分帧 5.加窗:对每一帧进行加窗, 6.进行fft傅里叶变换 librosa中fft计算,可以使用.net中的System.Numerics MathNet.Nume

  • python音频处理用到的操作的示例代码

    前言 本文主要记录python下音频常用的操作,以.wav格式文件为例.其实网上有很多现成的音频工具包,如果仅仅调用,工具包是更方便的. 更多pyton下的操作可以参考: 用python做科学计算 1.批量读取.wav文件名: 这里用到字符串路径: 1.通常意义字符串(str) 2.原始字符串,以大写R 或 小写r开始,r'',不对特殊字符进行转义 3.Unicode字符串,u'' basestring子类 如: path = './file/n' path = r'.\file\n' path

  • 音频处理 windows10下python三方库librosa安装教程

    librosa是处理音频库里的opencv,使用python脚本研究音频,先安装三方库librosa. 如下通过清华镜像源安装librosa: pip install -i https://pypi.tuna.tsinghua.edu.cn/simple librosa D:\D00_Python3\D00A2_python3.7.3\install>pip install -i https://pypi.tuna.tsinghua.edu.cn/simple librosa   Looking

  • C++通过内嵌解释器调用Python及间接调用Python三方库

    目录 1.移植Python解释器 2.VS配置(VS2017为例,此教程与VS版本无关) 3.C++调用程序样例 4.被调Python程序样例 本文章目的是脱离安装Python环境的前提下,由C++程序调用Python程序及Python相关三方库 1.移植Python解释器 Python环境的目录结构 路径详解 需要用的如下图 1.红色部分是生成路径下解释器运行时依赖 将红色部分拷贝到C++编译主ExE路径下即可 2.蓝色部分是VS配置编译时依赖 路径或文件名 作用 DLLs Python内部运

  • windows下python之mysqldb模块安装方法

    之所以会写下这篇日志,是因为安装的过程有点虐心.目前这篇文章是针对windows操作系统上的mysqldb的安装.安装python的mysqldb模块,首先当然是找一些官方的网站去下载:https://pypi.python.org/pypi/MySQL-python.下载后,cmd进入MySQL-python-1.2.3文件夹,按常规的执行python setup.py install 命令安装此模块,然后就报错了: 这个报错很明显,print 进行python前,应该先确定当前mysqldb

  • python 第三方库的安装及pip的使用详解

    python是一款简单易用的编程语言,特别是其第三方库,能够方便我们快速进入工作,但其第三方库的安装困扰很多人. 现在安装python时,已经能自动安装pip了 安装成功后,我们可以在Scripts 文件夹下看到pip 使用pip 安装类库也比较简单 pip install ... 即可 以上这篇python 第三方库的安装及pip的使用详解就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持我们.

  • Python 数据处理库 pandas 入门教程基本操作

    pandas是一个Python语言的软件包,在我们使用Python语言进行机器学习编程的时候,这是一个非常常用的基础编程库.本文是对它的一个入门教程. pandas提供了快速,灵活和富有表现力的数据结构,目的是使"关系"或"标记"数据的工作既简单又直观.它旨在成为在Python中进行实际数据分析的高级构建块. 入门介绍 pandas适合于许多不同类型的数据,包括: 具有异构类型列的表格数据,例如SQL表格或Excel数据 有序和无序(不一定是固定频率)时间序列数据.

  • Python 数据处理库 pandas进阶教程

    前言 本文紧接着前一篇的入门教程,会介绍一些关于pandas的进阶知识.建议读者在阅读本文之前先看完pandas入门教程. 同样的,本文的测试数据和源码可以在这里获取: Github:pandas_tutorial. 数据访问 在入门教程中,我们已经使用过访问数据的方法.这里我们再集中看一下. 注:这里的数据访问方法既适用于Series,也适用于DataFrame. 基础方法:[]和. 这是两种最直观的方法,任何有面向对象编程经验的人应该都很容易理解.下面是一个代码示例: # select_da

  • 详解python polyscope库的安装和例程

    安装就可以在环境配置好的情况下使用pip安装: pip install polyscope 如果提示找不到库文件,no moudle的话可以试着把安装下来的polyscope文件夹放在和想要运行的py文件的同一目录下. 而我们安装下来的polyscope文件夹在哪里呢?它们应该位于安装目录中的"Lib/site-packages"中,我的如下图所示: 但是装好之后我们运行一个网上的例程: import polyscope as ps # Initialize polyscope ps.

  • python BeautifulSoup库的安装与使用

    1.BeautifulSoup简介 BeautifulSoup4和 lxml 一样,Beautiful Soup 也是一个HTML/XML的解析器,主要的功能也是如何解析和提取 HTML/XML 数据. BeautifulSoup支持Python标准库中的HTML解析器,还支持一些第三方的解析器,如果我们不安装它,则 Python 会使用 Python默认的解析器,lxml 解析器更加强大,速度更快,推荐使用lxml 解析器. Beautiful Soup自动将输入文档转换为Unicode编码,

  • 详解python第三方库的安装、PyInstaller库、random库

    python第三方库的安装 PyInstaller库 PyInstaller库能够在不同操作系统下将python源文件打包,变成直接可运行的可执行文件. 可以通过-F参数对python源文件生成一个独立的可执行文件. PyInstaller -F SnowView.py 执行后在dist目录中出现了SnowView.exe可执行文件. random库 使用random库来生成随机数 最基本 random.random() 生成一个0~1之间的随机小数 from random import * p

  • python beautiful soup库入门安装教程

    目录 beautiful soup库的安装 beautiful soup库的理解 beautiful soup库的引用 BeautifulSoup类 回顾demo.html Tag标签 Tag的attrs(属性) Tag的NavigableString HTML基本格式 标签树的下行遍历 标签树的上行遍历 标签的平行遍历 bs库的prettify()方法 bs4库的编码 beautiful soup库的安装 pip install beautifulsoup4 beautiful soup库的理

随机推荐