[This is a brief note so I don't forget how to do this, and will probably be technically obsolete before long!]
Essentia is an "Open-source library and tools for audio and music analysis, description and synthesis" (https://essentia.upf.edu)
If you use Jupyter Lab / notebooks and therefore manage your Python environments using Anaconda, AND your machine is macOS, you will not be able to install Essentia out of the box. This is because:
pip install essentiais currently Linux onlybrew install essentia(https://github.com/MTG/homebrew-essentia) is incompatible with Anacondaconda install essentiadoes not (yet) exist (MTG/essentia#777)
If you try to install Essentia from source (https://essentia.upf.edu/documentation/installing.html) using an Anaconda environment on macOS, you will find that a bug in CPython means that ./waf configure [...] fails:
However:
- homebrew's Python does not suffer from the same issue
- The issue above is only relevant in the
configurestep and not theinstallsteps.
So! A hacky, ugly, probably broken somewhere/somehow workaround, is:
- Do
./waf configure [...]using Python installed via homebrew (brew install python) rather than Anaconda - Then complete the rest of the installation using Anaconda's Python
Your essentia installation may end up in /usr/local/lib/python3.7/site-packages/, so you then need to add this to your Anaconda path:
import sys
sys.path.append('/usr/local/lib/python3.7/site-packages/') # not permanent
Now you should be able to import essentia from your Anaconda environment.
Yes, I did say it's ugly.
Since my trials to install essentia failed many times with Homebrew, I tried to find an installation process using macports.
I run this on a Mid-2015 Mac Book Pro with Mac OSX 10.15 Catalina, it worked also on 10.13 High Sierra.
Please be aware that these operations can compromise your previous working environments or projects, so be aware and make a backup before even starting this step-by-step.
That said, I hope it will be useful to others.
install Mac Ports as explained in the doc and Xcode Command Line Tool
install the required port packages:
chromaprint dependencies include python 3.10 (as of november 2022)
at the end of the installation run one or both:
create a virtual environment and activate it:
make sure you have activated the virtual environment and install python packages necessaries for essentia,
download essentia source code with git
read the essentia doc on how to configure, build and install.
Normally the variable VIRTUAL_ENV has been created during virtualenv installation, just in case, you can check it:
then you can start configuring:
here is the waf doc if you need any further informations and you can check this post from @xaviliz about this procedure into a virtual environment.
Build
Install
if everything goes well you will see this beautiful message:
with these steps essentia has been installated in
env/lib/python3.10/site-packages/essentia/I don't know how to change this during the installation process without compromising it. If anyone has suggestions ...the output should be