根据官网教程,首先尝试pip安装
pip3 install music21
显示安装成功,但打开python之后输入
import music21
显示未找到该package
ModuleNotFoundError: No module named 'music21'
返回去看安装时报错defrecation
DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
应该是pip在os平台取消维护的锅,所以尝试conda安装
在官网找到安装包Music21 :: Anaconda.org
conda install -c conda-forge music21
成功✌️