kaldi-asr / kaldi

kaldi-asr/kaldi is the official location of the Kaldi project.
http://kaldi-asr.org
Other
13.92k stars 5.29k forks source link

Kaldi still need python2.7 when being built on macOS #4725

Open haaddii opened 2 years ago

haaddii commented 2 years ago

Python2.7 had been removed from macOS since 12.3. But it seems like the build process still need python2.

And since I am using an arm based machine, I can't install python2 since there's no such package for Darwin arm64.

I try to build it without python2 and didn't provide openblas path for expecting it using the accerlate. It stops without printout any unexpected errors after printing a lot lines of "checking" and "config.status". run.log

jtrmal commented 2 years ago

thanks for reporting this I think you could install python2.7 via brew but not sure if it's a good solution. Kaldi still needs py2.7, unfortunately (or to be precise, at least some scripts in some recipes do). But most of the main scripts should run just fine once you get past the kaldi install.

On Tue, Apr 12, 2022 at 6:03 PM Hardy @.***> wrote:

Python2.7 had been removed from macOS since 12.3. But it seems like the build process still need python2.

I tried built it without python2 and didn't provide openblas path for expecting it using the accerlate. And it stops without printout any unexpected errors after printing a lot lines of "checking" and "config.status". run.log https://github.com/kaldi-asr/kaldi/files/8476844/run.log

— Reply to this email directly, view it on GitHub https://github.com/kaldi-asr/kaldi/issues/4725, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACUKYX2AKVTPP43PGTIFLALVEXXJHANCNFSM5TIVBDHA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

kkm000 commented 2 years ago

My POV is that if someone wants to run an antiquated recipe, they should simply check out a version of Kaldi around the time the recipe was built with. That, among other things, is the best for reproducing a corresponding paper's results. I would not worry about egs, only the common scripts. @jtrmal, whadya think?

danpovey commented 2 years ago

I'd be OK to have python2.7 be removed from the dependency list. It seems only a few local scripts still require it.

haaddii commented 2 years ago

Update: And since I am using an arm based machine, I can't install python2 since there's no such package for Darwin arm64. It's my fault for not doing further googling. I just thought I can't install python2 on my machine, since the brew install python2 command install a x86 version for me and fail with error saying wrong arch or so.

But actually I can use Pyenv to install a Cpython2.7 then install virtualenv and create a venv, source it. So then I can have a python2.7 that is arm64 on a M1 series system.

I can have kaldi running on my machine now. Though it would be great if python3 can be the default python version in kaldi.

hemakaveri commented 1 year ago

Is it possible to simply alias python with python3 and use it with the dependency on python2.7 removed from the list of dependencies?

jtrmal commented 1 year ago

it is not that easy to do it this way, unfortunately y.

On Thu, Feb 23, 2023 at 12:39 AM hemakaveri @.***> wrote:

Is it possible to simply alias python with python3 and use it with the dependency on python2.7 removed from the list of dependencies?

— Reply to this email directly, view it on GitHub https://github.com/kaldi-asr/kaldi/issues/4725#issuecomment-1441241385, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACUKYX3XKCLEWAJMW3GPJE3WY3ZX3ANCNFSM5TIVBDHA . You are receiving this because you were mentioned.Message ID: @.***>

hemakaveri commented 1 year ago

Is there any other way?

On Thu, 23 Feb 2023 at 20:34, jtrmal @.***> wrote:

it is not that easy to do it this way, unfortunately y.

On Thu, Feb 23, 2023 at 12:39 AM hemakaveri @.***> wrote:

Is it possible to simply alias python with python3 and use it with the dependency on python2.7 removed from the list of dependencies?

— Reply to this email directly, view it on GitHub <https://github.com/kaldi-asr/kaldi/issues/4725#issuecomment-1441241385 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/ACUKYX3XKCLEWAJMW3GPJE3WY3ZX3ANCNFSM5TIVBDHA

. You are receiving this because you were mentioned.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/kaldi-asr/kaldi/issues/4725#issuecomment-1441942769, or unsubscribe https://github.com/notifications/unsubscribe-auth/A3QCDVZAIXJKSAXN34PGH3LWY537BANCNFSM5TIVBDHA . You are receiving this because you commented.Message ID: @.***>

jtrmal commented 1 year ago

no other way as far as I am aware. y.

On Thu, Feb 23, 2023 at 10:37 AM hemakaveri @.***> wrote:

Is there any other way?

On Thu, 23 Feb 2023 at 20:34, jtrmal @.***> wrote:

it is not that easy to do it this way, unfortunately y.

On Thu, Feb 23, 2023 at 12:39 AM hemakaveri @.***> wrote:

Is it possible to simply alias python with python3 and use it with the dependency on python2.7 removed from the list of dependencies?

— Reply to this email directly, view it on GitHub < https://github.com/kaldi-asr/kaldi/issues/4725#issuecomment-1441241385 , or unsubscribe <

https://github.com/notifications/unsubscribe-auth/ACUKYX3XKCLEWAJMW3GPJE3WY3ZX3ANCNFSM5TIVBDHA

. You are receiving this because you were mentioned.Message ID: @.***>

— Reply to this email directly, view it on GitHub <https://github.com/kaldi-asr/kaldi/issues/4725#issuecomment-1441942769 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/A3QCDVZAIXJKSAXN34PGH3LWY537BANCNFSM5TIVBDHA

. You are receiving this because you commented.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/kaldi-asr/kaldi/issues/4725#issuecomment-1441993680, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACUKYX7MUJDILXF73GRFWO3WY574XANCNFSM5TIVBDHA . You are receiving this because you were mentioned.Message ID: @.***>

hemakaveri commented 1 year ago

The problem is that new Mac machines (M1, M2) donot support python 2.7. -hema

On Thu, Feb 23, 2023 at 9:22 PM jtrmal @.***> wrote:

no other way as far as I am aware. y.

On Thu, Feb 23, 2023 at 10:37 AM hemakaveri @.***> wrote:

Is there any other way?

On Thu, 23 Feb 2023 at 20:34, jtrmal @.***> wrote:

it is not that easy to do it this way, unfortunately y.

On Thu, Feb 23, 2023 at 12:39 AM hemakaveri @.***> wrote:

Is it possible to simply alias python with python3 and use it with the dependency on python2.7 removed from the list of dependencies?

— Reply to this email directly, view it on GitHub < https://github.com/kaldi-asr/kaldi/issues/4725#issuecomment-1441241385 , or unsubscribe <

https://github.com/notifications/unsubscribe-auth/ACUKYX3XKCLEWAJMW3GPJE3WY3ZX3ANCNFSM5TIVBDHA

. You are receiving this because you were mentioned.Message ID: @.***>

— Reply to this email directly, view it on GitHub < https://github.com/kaldi-asr/kaldi/issues/4725#issuecomment-1441942769 , or unsubscribe <

https://github.com/notifications/unsubscribe-auth/A3QCDVZAIXJKSAXN34PGH3LWY537BANCNFSM5TIVBDHA

. You are receiving this because you commented.Message ID: @.***>

— Reply to this email directly, view it on GitHub <https://github.com/kaldi-asr/kaldi/issues/4725#issuecomment-1441993680 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/ACUKYX7MUJDILXF73GRFWO3WY574XANCNFSM5TIVBDHA

. You are receiving this because you were mentioned.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/kaldi-asr/kaldi/issues/4725#issuecomment-1442019151, or unsubscribe https://github.com/notifications/unsubscribe-auth/A3QCDV4DEDY62KNUPUB6RI3WY6BURANCNFSM5TIVBDHA . You are receiving this because you commented.Message ID: @.***>

kkm000 commented 1 year ago

I think python 2 has been dead so thoroughly for so long a time that hardly anyone would want to run the egs that require it.

Let's remove it from general dependencies. It's causing problems and, besides, simply embarrassing... :)

danijel3 commented 11 months ago

I'd like to reopen this issue again for discussion because Python2 is being fazed out of main Linux distros. For example: https://wiki.debian.org/Python/2Removal, so you can't even build Kaldi on current stable version of Debian.

The only reason for python2 was (I think) due to Phonetisaurus, but that also got upgraded to python3, afaik.

aaronchantrill commented 4 months ago

Python 2.7 is no longer available with Debian Bookworm. I was able to edit the check_dependencies.sh script in tools to get past that check, and then created the python directory and .use_default_python file in tools. I did not install python 2.7, and so far I haven't run into anything that actually requires it. Could it be made an optional, suggested component?

turinaf commented 1 month ago

@aaronchantrill I'm also trying to install kaldi on ubuntu, but couldn't get past the python2 requirement. May I know how you did it? Thank you.

aaronchantrill commented 1 month ago

@turinaf - sorry, I haven't been checking my email the last couple of days. Here is the diff for the check_dependencies.sh script:

@@ -93,11 +93,11 @@ if ! have awk; then
 fi

 pythonok=true
-if ! have python2.7; then
-  echo "$0: python2.7 is not installed"
-  add_packages python27 python2.7
-  pythonok=false
-fi
+#if ! have python2.7; then
+#  echo "$0: python2.7 is not installed"
+#  add_packages python27 python2.7
+#  pythonok=false
+#fi

 if ! have python3; then
   echo "$0: python3 is not installed"
@@ -108,13 +108,13 @@ fi
 (
 #Use a subshell so that sourcing env.sh does not have an influence on the rest of the script
 [ -f ./env.sh ] && . ./env.sh
-if $pythonok && ! have python2; then
-  mkdir -p $PWD/python
-  echo "$0: python2.7 is installed, but the python2 binary does not exist." \
-       "Creating a symlink and adding this to tools/env.sh"
-  ln -s $(command -v python2.7) $PWD/python/python2
-  echo "export PATH=$PWD/python:\${PATH}" >> env.sh
-fi
+#if $pythonok && ! have python2; then
+#  mkdir -p $PWD/python
+#  echo "$0: python2.7 is installed, but the python2 binary does not exist." \
+#       "Creating a symlink and adding this to tools/env.sh"
+#  ln -s $(command -v python2.7) $PWD/python/python2
+#  echo "export PATH=$PWD/python:\${PATH}" >> env.sh
+#fi

 if [[ -f $PWD/python/.use_default_python && -f $PWD/python/python ]]; then

It looks like I just commented out the checks. It's not great, but like I said, Kaldi seems to work without Python 2.7 (at least everything I've tried).

Like I said, I think I also had to create a .use_default_python file in the tools/python directory to get it to stop complaining.