Montreal-Forced-Aligner icon indicating copy to clipboard operation
Montreal-Forced-Aligner copied to clipboard

Separate the MFA source codes from the dependencies in the conda package

Open tshmak opened this issue 3 years ago • 6 comments

Would it be possible to separate the source codes (i.e. what's in this repository) from the dependencies (kaldi, etc.) in the conda MFA package? In this way, it will be easier for users to help debug the program by installing only the dependencies through conda and compiling MFA source codes through, e.g., pip install -e. Also, you will not need to update conda every time you make a patch.

tshmak avatar Dec 14 '21 02:12 tshmak

I'm confused, can you not install it via pip install -e .? It works for me, additionally it supports python setup.py install, python setup.py develop and python -m build . variants. It's hosted on pypi and can be installed via pip, so it doesn't have to be installed via conda, it's just that there's not much functionality without the thirdparty, non-Python dependencies that conda handles, but you should be able to follow the instructions here if you don't want to use that: https://montreal-forced-aligner.readthedocs.io/en/latest/installation.html#installing-from-source

mmcauliffe avatar Dec 14 '21 05:12 mmcauliffe

I mean is it possible to package all of steps 1-3 in https://montreal-forced-aligner.readthedocs.io/en/latest/installation.html#installing-from-source into a conda package? I was supposing that the current conda install more or less performs steps 1-4. I tried doing conda remove montreal-forced-aligner and pip install -e . after conda install montreal-forced-aligner, but that seems to be removing too much.

tshmak avatar Dec 14 '21 06:12 tshmak

You can set up the environment with:

conda install kaldi pynini

on mac/linux (and minus pynini on Windows) and that will have all the conda-only dependencies installed, at which point you can install MFA via pip.

mmcauliffe avatar Dec 14 '21 06:12 mmcauliffe

Will I need OpenGRM and OpenFST?

tshmak avatar Dec 14 '21 06:12 tshmak

Yes, but those are dependencies of Pynini, so you don't have to specify them.

mmcauliffe avatar Dec 14 '21 06:12 mmcauliffe

Actually, simply conda install kaldi pynini followed by pip install . doesn't work. First, I think you need pip install -r requirements.txt. But that didn't work for me either, as there seemed to be conflicts between scikit-learn and numpy.

For me, what worked was conda env create -n aligner --file environment.yml followed by pip install ..

However, I noticed that the current environment.yml does not contain openblas as a dependency. I haven't checked if it doesn't cause problems further down.

Also, in the future, I suggest fixing the version of the packages in environment.yml, if possible, to enhance reproducibility.

tshmak avatar Dec 15 '21 04:12 tshmak