Used https://k2-fsa.github.io/k2/installation/conda.html instructions to install k2.
$ conda install -c k2-fsa -c pytorch -c conda-forge k2 python=3.8 cudatoolkit=11.1 pytorch=1.8.1After installing k2, python couldn’t find it. Had to fix it by adding the alias to .bashrc to find it. It works if called from anaconda python.
np@np-INTEL:~$ python3 -m k2.version
/usr/bin/python3: Error while finding module specification for 'k2.version' (ModuleNotFoundError: No module named 'k2')fix add this line to .bashrc
alias python3='/home/np/anaconda3/bin/python'Open .bashrc
np@np-INTEL:~$ nano .bashrcAdd alias to .bashrc
# colored GCC warnings and errors
#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
alias python3='/home/np/anaconda3/bin/python'It work now. As per instructions I used conda to install k2, and looks like need python from anaconda to run k2.
Ask questions at: https://github.com/npovey/speech/discussions