Problem:UnicodeDecodeError: 'ascii' codec can't decode byte 0xcd in position 9: ordinal not in range(128)
catboost version: catboost 0.25
Operating System:win10
When I use setup.py to install Catboost, this error occurs, and if I look closely it is divided into two parts: 1. Using CUDA to create _catboost.pyd will cause an error like 'UnicodeDecodeError:' ASCII 'codec can't decode byte 0xCD in position 9: Ordinal not in range(128). 2. Do not use the CUDA to create _catboost. pyd, there will be "subprocess. CalledProcessError:Command '['D:\anaconda3\python.exe', 'D:\learn\catboost-master\ya', 'make', 'D:\learn\catboost-master\catboost\python-package\..\..\catboost\python-package\catboost', '--no-src-links', '--output', 'D:\ learn\ catboost-master\catboost\python-package\build\temp.win-amd64-3.8\Release', '-dpython_config =python3-config',' -duse_arcadia_python =no', '-dos_sdk =local', '-r','-DNO_DEBUGINFO', '-DHAVE_CUDA= NO '] returned non-zero exit status 1."
I also tried converting _catboost.pyx from GitHub to _catboost.pyd using 'python setup.py build_ext --inplace' directly, but I got the same error as when installing CatBoost.
C:\Users\王普聪>pip install -e D:\learn\catboost-master\catboost\python-package
Obtaining file:///D:/learn/catboost-master/catboost/python-package
Requirement already satisfied: graphviz in d:\anaconda3\lib\site-packages (from catboost==0.24.4) (0.16)
Requirement already satisfied: plotly in d:\anaconda3\lib\site-packages (from catboost==0.24.4) (4.14.3)
Requirement already satisfied: six in d:\anaconda3\lib\site-packages (from catboost==0.24.4) (1.15.0)
Requirement already satisfied: matplotlib in d:\anaconda3\lib\site-packages (from catboost==0.24.4) (3.2.2)
Requirement already satisfied: numpy>=1.16.0 in d:\anaconda3\lib\site-packages (from catboost==0.24.4) (1.18.5)
Requirement already satisfied: pandas>=0.24 in d:\anaconda3\lib\site-packages (from catboost==0.24.4) (1.0.5)
Requirement already satisfied: scipy in d:\anaconda3\lib\site-packages (from catboost==0.24.4) (1.5.0)
Requirement already satisfied: retrying>=1.3.3 in d:\anaconda3\lib\site-packages (from plotly->catboost==0.24.4) (1.3.3)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in d:\anaconda3\lib\site-packages (from matplotlib->catboost==0.24.4) (2.4.7)
Requirement already satisfied: cycler>=0.10 in d:\anaconda3\lib\site-packages (from matplotlib->catboost==0.24.4) (0.10.0)
Requirement already satisfied: kiwisolver>=1.0.1 in d:\anaconda3\lib\site-packages (from matplotlib->catboost==0.24.4) (1.2.0)
Requirement already satisfied: python-dateutil>=2.1 in d:\anaconda3\lib\site-packages (from matplotlib->catboost==0.24.4) (2.8.1)
Requirement already satisfied: pytz>=2017.2 in d:\anaconda3\lib\site-packages (from pandas>=0.24->catboost==0.24.4) (2020.1)
Installing collected packages: catboost
Running setup.py develop for catboost
ERROR: Command errored out with exit status 1:
command: 'D:\anaconda3\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'D:\\learn\\catboost-master\\catboost\\python-package\\setup.py'"'"'; __file__='"'"'D:\\learn\\catboost-master\\catboost\\python-package\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps
cwd: D:\learn\catboost-master\catboost\python-package\
Complete output (159 lines):
running develop
15:30:22 I Targeting for CUDA support with C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1
running egg_info
writing catboost.egg-info\PKG-INFO
writing dependency_links to catboost.egg-info\dependency_links.txt
writing requirements to catboost.egg-info\requires.txt
writing top-level names to catboost.egg-info\top_level.txt
15:30:24 I Targeting for CUDA support with C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1
reading manifest file 'catboost.egg-info\SOURCES.txt'
writing manifest file 'catboost.egg-info\SOURCES.txt'
running build_ext
15:30:24 I Targeting for CUDA support with C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1
15:30:24 I Buildling _catboost.pyd with ymake
15:30:24 I EXECUTE: D:\anaconda3\python.exe D:\learn\catboost-master\ya make D:\learn\catboost-master\catboost\python-package\..\..\catboost\python-package\catboost --no-src-links --output D:\learn\catboost-master\catboost\python-package\build\temp.win-amd64-3.8\Release -DPYTHON_CONFIG=python3-config -DUSE_ARCADIA_PYTHON=no -DOS_SDK=local -r -DNO_DEBUGINFO -DHAVE_CUDA=yes "-DCUDA_ROOT=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1"
Output root is subdirectory of Arcadia root, this may cause non-idempotent build
Traceback (most recent call last):
File "devtools/ya/app.py", line 422, in configure_exit_interceptor
yield
File "devtools/ya/app.py", line 65, in helper
return action(args)
File "devtools/ya/entry/entry.py", line 55, in do_main
res = handler.handle(handler, args, prefix=['ya'])
File "devtools/ya/core/handler.py", line 159, in handle
return handler.handle(self, args[1:], prefix + [name])
File "devtools/ya/core/dispatch.py", line 37, in handle
return self.command().handle(root_handler, args, prefix)
File "devtools/ya/core/handler.py", line 341, in handle
return self._action(params)
File "devtools/ya/app.py", line 92, in helper
return action(ctx.params)
File "devtools/ya/build/build_handler.py", line 85, in do_ya_make
builder = ya_make.YaMake(params, app_ctx)
File "devtools/ya/build/ya_make.py", line 895, in __init__
self.ctx = Context(self.opts, app_ctx=app_ctx, graph=graph, tests=tests, stripped_tests=stripped_tests, configure_errors=configure_errors, make_files=make_files, lite_graph=lite_graph)
File "devtools/ya/build/ya_make.py", line 574, in __init__
self.graph, self.tests, self.stripped_tests, self.configure_errors, self.make_files = _build_graph_and_tests(self.opts, app_ctx)
File "devtools/ya/build/ya_make.py", line 258, in _build_graph_and_tests
graph, tests, stripped_tests, gh, make_files = lg.build_graph_and_tests(opts, check=True, ev_listener=ev_listener, display=display)
File "devtools/ya/build/graph.py", line 1688, in build_graph_and_tests
return _build_graph_and_tests(opts, check, ev_listener, exit_stack, display)
File "devtools/ya/build/graph.py", line 1992, in _build_graph_and_tests
real_ymake_bin = tools.tool('ymake')
File "devtools/ya/yalibrary/tools/__init__.py", line 220, in tool
return toolchain.find(name, with_params, for_platform, cache=cache)
File "devtools/ya/yalibrary/tools/__init__.py", line 158, in find
executable = cur_bottle[executable_name] # if executable_name is None it's Ok
File "devtools/ya/yalibrary/tools/__init__.py", line 64, in __getitem__
path = self.resolve()
File "devtools/ya/yalibrary/tools/__init__.py", line 46, in resolve
return self.__fetcher.fetch_if_need(self.__formula["match"], tared, binname, cache=cache).where
File "devtools/ya/yalibrary/fetcher/__init__.py", line 385, in fetch_if_need
self.__c[key] = self._fetch_if_need(*args, **kwargs)
File "devtools/ya/yalibrary/fetcher/__init__.py", line 452, in _fetch_if_need
if self._fetch(name, tared, lambda x: name.lower() in x.lower(), binname):
File "devtools/ya/yalibrary/fetcher/__init__.py", line 368, in _fetch
_install(res_path, do_install)
File "devtools/ya/yalibrary/fetcher/__init__.py", line 104, in _install
fs_handler(install_guard)
File "devtools/ya/yalibrary/fetcher/__init__.py", line 95, in fs_handler
func(install_guard)
File "devtools/ya/yalibrary/fetcher/__init__.py", line 350, in do_install
deploy_params=(UNTAR, resource_info if resource_info else {"file_name": "FILE"}, ""))
File "devtools/ya/yalibrary/fetcher/__init__.py", line 137, in _deploy_tool
exts.archive.extract_from_tar(archive, extract_to)
File "devtools/ya/exts/archive.py", line 16, in extract_from_tar
archive.extract_tar(tar_file_path, output_dir)
File "library/python/archive/__init__.py", line 62, in extract_tar
output_dir = encode(output_dir, ENCODING)
File "library/python/archive/__init__.py", line 58, in encode
return value.encode(encoding)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xcd in position 9: ordinal not in range(128)
15:30:37 E Cannot build _catboost.pyd with CUDA support, will build without CUDA
15:30:37 I EXECUTE: D:\anaconda3\python.exe D:\learn\catboost-master\ya make D:\learn\catboost-master\catboost\python-package\..\..\catboost\python-package\catboost --no-src-links --output D:\learn\catboost-master\catboost\python-package\build\temp.win-amd64-3.8\Release -DPYTHON_CONFIG=python3-config -DUSE_ARCADIA_PYTHON=no -DOS_SDK=local -r -DNO_DEBUGINFO -DHAVE_CUDA=no
Output root is subdirectory of Arcadia root, this may cause non-idempotent build
Traceback (most recent call last):
File "devtools/ya/app.py", line 422, in configure_exit_interceptor
yield
File "devtools/ya/app.py", line 65, in helper
return action(args)
File "devtools/ya/entry/entry.py", line 55, in do_main
res = handler.handle(handler, args, prefix=['ya'])
File "devtools/ya/core/handler.py", line 159, in handle
return handler.handle(self, args[1:], prefix + [name])
File "devtools/ya/core/dispatch.py", line 37, in handle
return self.command().handle(root_handler, args, prefix)
File "devtools/ya/core/handler.py", line 341, in handle
return self._action(params)
File "devtools/ya/app.py", line 92, in helper
return action(ctx.params)
File "devtools/ya/build/build_handler.py", line 85, in do_ya_make
builder = ya_make.YaMake(params, app_ctx)
File "devtools/ya/build/ya_make.py", line 895, in __init__
self.ctx = Context(self.opts, app_ctx=app_ctx, graph=graph, tests=tests, stripped_tests=stripped_tests, configure_errors=configure_errors, make_files=make_files, lite_graph=lite_graph)
File "devtools/ya/build/ya_make.py", line 574, in __init__
self.graph, self.tests, self.stripped_tests, self.configure_errors, self.make_files = _build_graph_and_tests(self.opts, app_ctx)
File "devtools/ya/build/ya_make.py", line 258, in _build_graph_and_tests
graph, tests, stripped_tests, gh, make_files = lg.build_graph_and_tests(opts, check=True, ev_listener=ev_listener, display=display)
File "devtools/ya/build/graph.py", line 1688, in build_graph_and_tests
return _build_graph_and_tests(opts, check, ev_listener, exit_stack, display)
File "devtools/ya/build/graph.py", line 1992, in _build_graph_and_tests
real_ymake_bin = tools.tool('ymake')
File "devtools/ya/yalibrary/tools/__init__.py", line 220, in tool
return toolchain.find(name, with_params, for_platform, cache=cache)
File "devtools/ya/yalibrary/tools/__init__.py", line 158, in find
executable = cur_bottle[executable_name] # if executable_name is None it's Ok
File "devtools/ya/yalibrary/tools/__init__.py", line 64, in __getitem__
path = self.resolve()
File "devtools/ya/yalibrary/tools/__init__.py", line 46, in resolve
return self.__fetcher.fetch_if_need(self.__formula["match"], tared, binname, cache=cache).where
File "devtools/ya/yalibrary/fetcher/__init__.py", line 385, in fetch_if_need
self.__c[key] = self._fetch_if_need(*args, **kwargs)
File "devtools/ya/yalibrary/fetcher/__init__.py", line 452, in _fetch_if_need
if self._fetch(name, tared, lambda x: name.lower() in x.lower(), binname):
File "devtools/ya/yalibrary/fetcher/__init__.py", line 368, in _fetch
_install(res_path, do_install)
File "devtools/ya/yalibrary/fetcher/__init__.py", line 104, in _install
fs_handler(install_guard)
File "devtools/ya/yalibrary/fetcher/__init__.py", line 95, in fs_handler
func(install_guard)
File "devtools/ya/yalibrary/fetcher/__init__.py", line 350, in do_install
deploy_params=(UNTAR, resource_info if resource_info else {"file_name": "FILE"}, ""))
File "devtools/ya/yalibrary/fetcher/__init__.py", line 137, in _deploy_tool
exts.archive.extract_from_tar(archive, extract_to)
File "devtools/ya/exts/archive.py", line 16, in extract_from_tar
archive.extract_tar(tar_file_path, output_dir)
File "library/python/archive/__init__.py", line 62, in extract_tar
output_dir = encode(output_dir, ENCODING)
File "library/python/archive/__init__.py", line 58, in encode
return value.encode(encoding)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xcd in position 9: ordinal not in range(128)
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "D:\learn\catboost-master\catboost\python-package\setup.py", line 259, in <module>
setup(
File "D:\anaconda3\lib\site-packages\setuptools\__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "D:\anaconda3\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "D:\anaconda3\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "D:\anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "D:\anaconda3\lib\site-packages\setuptools\command\develop.py", line 34, in run
self.install_for_development()
File "D:\anaconda3\lib\site-packages\setuptools\command\develop.py", line 136, in install_for_development
self.run_command('build_ext')
File "D:\anaconda3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "D:\anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "D:\learn\catboost-master\catboost\python-package\setup.py", line 186, in run
self.build_with_ymake(topsrc_dir, build_dir, catboost_ext, put_dir, verbose, dry_run)
File "D:\learn\catboost-master\catboost\python-package\setup.py", line 219, in build_with_ymake
logging_execute(ymake_cmd + ['-DHAVE_CUDA=no'], verbose, dry_run)
File "D:\learn\catboost-master\catboost\python-package\setup.py", line 62, in logging_execute
subprocess.check_call(cmd, universal_newlines=True)
File "D:\anaconda3\lib\subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['D:\\anaconda3\\python.exe', 'D:\\learn\\catboost-master\\ya', 'make', 'D:\\learn\\catboost-master\\catboost\\python-package\\..\\..\\catboost\\python-package\\catboost', '--no-src-links', '--output', 'D:\\learn\\catboost-master\\catboost\\python-package\\build\\temp.win-amd64-3.8\\Release', '-DPYTHON_CONFIG=python3-config', '-DUSE_ARCADIA_PYTHON=no', '-DOS_SDK=local', '-r', '-DNO_DEBUGINFO', '-DHAVE_CUDA=no']' returned non-zero exit status 1.
----------------------------------------
ERROR: Command errored out with exit status 1: 'D:\anaconda3\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'D:\\learn\\catboost-master\\catboost\\python-package\\setup.py'"'"'; __file__='"'"'D:\\learn\\catboost-master\\catboost\\python-package\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps Check the logs for full command output.