Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

installation problems occurred during the K2 in windows. #1323

Open
zaheera01 opened this issue Jan 29, 2025 · 6 comments
Open

installation problems occurred during the K2 in windows. #1323

zaheera01 opened this issue Jan 29, 2025 · 6 comments

Comments

@zaheera01
Copy link

when i am installing the k2 in windows system with CUDA and GPU, python = 3.10 version, Cuda=11.8, cmake =3.18.0
and i am getting the following error.

(icefall)
user@DESKTOP-3MH2S61 MINGW64 /d/work_torgo/k2 (master)
$ python setup.py install
running install
C:\Users\user\anaconda3\anaconda\envs\icefall\lib\site-packages\setuptools_dist
utils\cmd.py:79: SetuptoolsDeprecationWarning: setup.py install is deprecated.
!!

    ************************************************************************

    Please avoid running ``setup.py`` directly.
    Instead, use pypa/build, pypa/installer or other
    standards-based tools.

    See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html fo

r details.
************************************************************************


!!
self.initialize_options()
C:\Users\user\anaconda3\anaconda\envs\icefall\lib\site-packages\setuptools_dist
utils\cmd.py:79: EasyInstallDeprecationWarning: easy_install command is deprecat
ed.
!!

    ************************************************************************

    Please avoid running ``setup.py`` and ``easy_install``.
    Instead, use pypa/build, pypa/installer or other
    standards-based tools.

    See https://github.com/pypa/setuptools/issues/917 for details.
    ************************************************************************

!!
self.initialize_options()
running bdist_egg
running egg_info
writing k2.egg-info\PKG-INFO
writing dependency_links to k2.egg-info\dependency_links.txt
writing requirements to k2.egg-info\requires.txt
writing top-level names to k2.egg-info\top_level.txt
reading manifest file 'k2.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
adding license file 'LICENSE'
writing manifest file 'k2.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
copying k2\python\k2\autograd.py -> build\lib.win-amd64-cpython-310\k2
copying k2\python\k2\autograd_utils.py -> build\lib.win-amd64-cpython-310\k2
copying k2\python\k2\ctc_loss.py -> build\lib.win-amd64-cpython-310\k2
copying k2\python\k2\decode.py -> build\lib.win-amd64-cpython-310\k2
copying k2\python\k2\dense_fsa_vec.py -> build\lib.win-amd64-cpython-310\k2
copying k2\python\k2\fsa.py -> build\lib.win-amd64-cpython-310\k2
copying k2\python\k2\fsa_algo.py -> build\lib.win-amd64-cpython-310\k2
copying k2\python\k2\fsa_properties.py -> build\lib.win-amd64-cpython-310\k2
copying k2\python\k2\mutual_information.py -> build\lib.win-amd64-cpython-310\k2
copying k2\python\k2\mwer_loss.py -> build\lib.win-amd64-cpython-310\k2
copying k2\python\k2\nbest.py -> build\lib.win-amd64-cpython-310\k2
copying k2\python\k2\online_dense_intersecter.py -> build\lib.win-amd64-cpython-
310\k2
copying k2\python\k2\ops.py -> build\lib.win-amd64-cpython-310\k2
copying k2\python\k2\rnnt_decode.py -> build\lib.win-amd64-cpython-310\k2
copying k2\python\k2\rnnt_loss.py -> build\lib.win-amd64-cpython-310\k2
copying k2\python\k2\symbol_table.py -> build\lib.win-amd64-cpython-310\k2
copying k2\python\k2\utils.py -> build\lib.win-amd64-cpython-310\k2
copying k2\python\k2_init_.py -> build\lib.win-amd64-cpython-310\k2
copying k2\python\k2\ragged_init_.py -> build\lib.win-amd64-cpython-310\k2\ra
gged
copying k2\python\k2\sparse\autograd.py -> build\lib.win-amd64-cpython-310\k2\sp
arse
copying k2\python\k2\sparse_init_.py -> build\lib.win-amd64-cpython-310\k2\sp
arse
copying k2\python\k2\version\version.py -> build\lib.win-amd64-cpython-310\k2\ve
rsion
copying k2\python\k2\version_init_.py -> build\lib.win-amd64-cpython-310\k2\v
ersion
copying k2\python\k2\version_main_.py -> build\lib.win-amd64-cpython-310\k2\v
ersion
running build_ext
cmake_path: C:\Program Files\cmake\cmake-3.11.0-win64-x64\cmake-3.11.0-win64-x64
\bin\cmake.EXE
Setting PYTHON_EXECUTABLE to C:\Users\user\anaconda3\anaconda\envs\icefall\pytho
n.exe
build command is:

            cmake -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=C:\Users\us

er\anaconda3\anaconda\envs\icefall\python.exe -DK2_ENABLE_BENCHMARK=OFF -DK2_EN
ABLE_TESTS=OFF -DCMAKE_INSTALL_PREFIX=D:\work_torgo\k2\build\lib.win-amd64-cpyt
hon-310/k2 -DCMAKE_CXX_STANDARD=17 -B build\temp.win-amd64-cpython-310\Release
-S D:\work_torgo\k2
cmake --build build\temp.win-amd64-cpython-310\Release --target
install --config Release -- -m

-- Building for: Visual Studio 14 2015
CMake Error: Error: generator : Visual Studio 14 2015
Does not match the generator used previously: Visual Studio 17 2022
Either remove the CMakeCache.txt file and CMakeFiles directory or choose a diffe
rent binary directory.
Traceback (most recent call last):
File "D:\work_torgo\k2\setup.py", line 240, in
setuptools.setup(
File "C:\Users\user\anaconda3\anaconda\envs\icefall\lib\site-packages\setuptoo
ls_init_.py", line 117, in setup
return distutils.core.setup(**attrs)
File "C:\Users\user\anaconda3\anaconda\envs\icefall\lib\site-packages\setuptoo
ls_distutils\core.py", line 186, in setup
return run_commands(dist)
File "C:\Users\user\anaconda3\anaconda\envs\icefall\lib\site-packages\setuptoo
ls_distutils\core.py", line 202, in run_commands
dist.run_commands()
File "C:\Users\user\anaconda3\anaconda\envs\icefall\lib\site-packages\setuptoo
ls_distutils\dist.py", line 983, in run_commands
self.run_command(cmd)
File "C:\Users\user\anaconda3\anaconda\envs\icefall\lib\site-packages\setuptoo
ls\dist.py", line 999, in run_command
super().run_command(command)
File "C:\Users\user\anaconda3\anaconda\envs\icefall\lib\site-packages\setuptoo
ls_distutils\dist.py", line 1002, in run_command
cmd_obj.run()
File "C:\Users\user\anaconda3\anaconda\envs\icefall\lib\site-packages\setuptoo
ls\command\install.py", line 109, in run
self.do_egg_install()
File "C:\Users\user\anaconda3\anaconda\envs\icefall\lib\site-packages\setuptoo
ls\command\install.py", line 167, in do_egg_install
self.run_command('bdist_egg')
File "C:\Users\user\anaconda3\anaconda\envs\icefall\lib\site-packages\setuptoo
ls_distutils\cmd.py", line 339, in run_command
self.distribution.run_command(command)
File "C:\Users\user\anaconda3\anaconda\envs\icefall\lib\site-packages\setuptoo
ls\dist.py", line 999, in run_command
super().run_command(command)
File "C:\Users\user\anaconda3\anaconda\envs\icefall\lib\site-packages\setuptoo
ls_distutils\dist.py", line 1002, in run_command
cmd_obj.run()
File "C:\Users\user\anaconda3\anaconda\envs\icefall\lib\site-packages\setuptoo
ls\command\bdist_egg.py", line 177, in run
cmd = self.call_command('install_lib', warn_dir=False)
File "C:\Users\user\anaconda3\anaconda\envs\icefall\lib\site-packages\setuptoo
ls\command\bdist_egg.py", line 163, in call_command
self.run_command(cmdname)
File "C:\Users\user\anaconda3\anaconda\envs\icefall\lib\site-packages\setuptoo
ls_distutils\cmd.py", line 339, in run_command
self.distribution.run_command(command)
File "C:\Users\user\anaconda3\anaconda\envs\icefall\lib\site-packages\setuptoo
ls\dist.py", line 999, in run_command
super().run_command(command)
File "C:\Users\user\anaconda3\anaconda\envs\icefall\lib\site-packages\setuptoo
ls_distutils\dist.py", line 1002, in run_command
cmd_obj.run()
File "C:\Users\user\anaconda3\anaconda\envs\icefall\lib\site-packages\setuptoo
ls\command\install_lib.py", line 19, in run
self.build()
File "C:\Users\user\anaconda3\anaconda\envs\icefall\lib\site-packages\setuptoo
ls_distutils\command\install_lib.py", line 110, in build
self.run_command('build_ext')
File "C:\Users\user\anaconda3\anaconda\envs\icefall\lib\site-packages\setuptoo
ls_distutils\cmd.py", line 339, in run_command
self.distribution.run_command(command)
File "C:\Users\user\anaconda3\anaconda\envs\icefall\lib\site-packages\setuptoo
ls\dist.py", line 999, in run_command
super().run_command(command)
File "C:\Users\user\anaconda3\anaconda\envs\icefall\lib\site-packages\setuptoo
ls_distutils\dist.py", line 1002, in run_command
cmd_obj.run()
File "C:\Users\user\anaconda3\anaconda\envs\icefall\lib\site-packages\setuptoo
ls\command\build_ext.py", line 99, in run
_build_ext.run(self)
File "C:\Users\user\anaconda3\anaconda\envs\icefall\lib\site-packages\setuptoo
ls_distutils\command\build_ext.py", line 365, in run
self.build_extensions()
File "C:\Users\user\anaconda3\anaconda\envs\icefall\lib\site-packages\setuptoo
ls_distutils\command\build_ext.py", line 481, in build_extensions
self._build_extensions_serial()
File "C:\Users\user\anaconda3\anaconda\envs\icefall\lib\site-packages\setuptoo
ls_distutils\command\build_ext.py", line 507, in _build_extensions_serial
self.build_extension(ext)
File "D:\work_torgo\k2\setup.py", line 191, in build_extension
raise Exception("Failed to build k2")
Exception: Failed to build k2
(icefall)

Help me out from this..

@csukuangfj
Copy link
Collaborator

Please delete the k2 project and retry.

Make sure you follow the doc exactly.

@zaheera01
Copy link
Author

I have done it as you said...
I am getting error cmake error...

Here is the error.
running build_ext
cmake_path: C:\Program Files\cmake\cmake-3.11.0-win64-x64\cmake-3.11.0-win64-x64
\bin\cmake.EXE
Setting PYTHON_EXECUTABLE to C:\Users\user\anaconda3\anaconda\envs\icefall\pytho
n.exe
build command is:

     cmake -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=C:\Users\us

er\anaconda3\anaconda\envs\icefall\python.exe -DK2_ENABLE_BENCHMARK=OFF -DK2_EN
ABLE_TESTS=OFF -DCMAKE_INSTALL_PREFIX=D:\work_torgo\k2\build\lib.win-amd64-cpyt
hon-310/k2 -DCMAKE_CXX_STANDARD=17 -B build\temp.win-amd64-cpython-310\Release
-S D:\work_torgo\k2
cmake --build build\temp.win-amd64-cpython-310\Release --target
install --config Release -- -m

-- Building for: Visual Studio 14 2015
CMake Error: Error: generator : Visual Studio 14 2015
Does not match the generator used previously: Visual Studio 17 2022
Either remove the CMakeCache.txt file and CMakeFiles directory or choose a diffe
rent binary directory.

@csukuangfj
Copy link
Collaborator

Have you deleted the k2 project and retry?

Please post screenshots describing the commands you have run?

@zaheera01
Copy link
Author

ok..
the k2 documentation which i have used, the link " https://k2-fsa.github.io/k2/installation/from_source.html "

GCC Version:
user@DESKTOP-3MH2S61 MINGW64 /d/work_torgo/k2 (master)
$ gcc --version
gcc.exe (GCC) 13.2.0
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

user@DESKTOP-3MH2S61 MINGW64 /d/work_torgo/k2 (master)
$ cmake --version
cmake version 3.11.0

CMake suite maintained and supported by Kitware (kitware.com/cmake).

AFter setting it to GCc and Cmake . directly i went to k2 and executed the "setup.py "

Image

Image

Image

Image

@csukuangfj
Copy link
Collaborator

As said before, you have to delete the k2 project and retry.

Please post all.screenshots, including the.one about how you.delete k2

@csukuangfj
Copy link
Collaborator

Your first step is wrong. Remember to follow.the doc.exactly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants