-2

I am trying to install Sudachipy on my Windows machine. I tried directly from the tar file and with pip but I keep having the following error. When I check my installation in Settings>Apps&Features I see several versions of Microsoft Viusal C++, including the 2015-2019 Redistributable(x86) - 14.29.30040 The Package ask for 14. or higher. What is wrong here?

Collecting sudachipy
  Using cached SudachiPy-0.5.4.tar.gz (86 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: sortedcontainers~=2.1.0 in c:\users\m\appdata\local\programs\python\python39\lib\site-packages (from sudachipy) (2.1.0)
Collecting dartsclone~=0.9.0
  Using cached dartsclone-0.9.0.tar.gz (17 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: Cython in c:\users\m\appdata\local\programs\python\python39\lib\site-packages (from dartsclone~=0.9.0->sudachipy) (0.29.24)
Building wheels for collected packages: sudachipy, dartsclone
  Building wheel for sudachipy (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:\Users\mdelal001\AppData\Local\Programs\Python\Python39\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\m\\AppData\\Local\\Temp\\pip-install-oal03kk3\\sudachipy_227636af8754449b96ce8e87e2caa18e\\setup.py'"'"'; __file__='"'"'C:\\Users\\m\\AppData\\Local\\Temp\\pip-install-oal03kk3\\sudachipy_227636af8754449b96ce8e87e2caa18e\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\m\AppData\Local\Temp\pip-wheel-dn9unuux'
       cwd: C:\Users\m\AppData\Local\Temp\pip-install-oal03kk3\sudachipy_227636af8754449b96ce8e87e2caa18e\
  Complete output (74 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.9
  creating build\lib.win-amd64-3.9\sudachipy
  copying sudachipy\command_line.py -> build\lib.win-amd64-3.9\sudachipy
  copying sudachipy\config.py -> build\lib.win-amd64-3.9\sudachipy
  copying sudachipy\dictionary.py -> build\lib.win-amd64-3.9\sudachipy
  copying sudachipy\morpheme.py -> build\lib.win-amd64-3.9\sudachipy
  copying sudachipy\morphemelist.py -> build\lib.win-amd64-3.9\sudachipy
  copying sudachipy\utf8inputtext.py -> build\lib.win-amd64-3.9\sudachipy
  copying sudachipy\utf8inputtextbuilder.py -> build\lib.win-amd64-3.9\sudachipy
  copying sudachipy\__init__.py -> build\lib.win-amd64-3.9\sudachipy
  creating build\lib.win-amd64-3.9\sudachipy\dictionarylib
  copying sudachipy\dictionarylib\binarydictionary.py -> build\lib.win-amd64-3.9\sudachipy\dictionarylib
  copying sudachipy\dictionarylib\categorytype.py -> build\lib.win-amd64-3.9\sudachipy\dictionarylib
  copying sudachipy\dictionarylib\charactercategory.py -> build\lib.win-amd64-3.9\sudachipy\dictionarylib
  copying sudachipy\dictionarylib\dictionarybuilder.py -> build\lib.win-amd64-3.9\sudachipy\dictionarylib
  copying sudachipy\dictionarylib\dictionaryheader.py -> build\lib.win-amd64-3.9\sudachipy\dictionarylib
  copying sudachipy\dictionarylib\dictionaryversion.py -> build\lib.win-amd64-3.9\sudachipy\dictionarylib
  copying sudachipy\dictionarylib\doublearraylexicon.py -> build\lib.win-amd64-3.9\sudachipy\dictionarylib
  copying sudachipy\dictionarylib\grammar.py -> build\lib.win-amd64-3.9\sudachipy\dictionarylib
  copying sudachipy\dictionarylib\jtypedbytebuffer.py -> build\lib.win-amd64-3.9\sudachipy\dictionarylib
  copying sudachipy\dictionarylib\lexicon.py -> build\lib.win-amd64-3.9\sudachipy\dictionarylib
  copying sudachipy\dictionarylib\lexiconset.py -> build\lib.win-amd64-3.9\sudachipy\dictionarylib
  copying sudachipy\dictionarylib\userdictionarybuilder.py -> build\lib.win-amd64-3.9\sudachipy\dictionarylib
  copying sudachipy\dictionarylib\wordidtable.py -> build\lib.win-amd64-3.9\sudachipy\dictionarylib
  copying sudachipy\dictionarylib\wordinfo.py -> build\lib.win-amd64-3.9\sudachipy\dictionarylib
  copying sudachipy\dictionarylib\wordinfolist.py -> build\lib.win-amd64-3.9\sudachipy\dictionarylib
  copying sudachipy\dictionarylib\wordparameterlist.py -> build\lib.win-amd64-3.9\sudachipy\dictionarylib
  copying sudachipy\dictionarylib\__init__.py -> build\lib.win-amd64-3.9\sudachipy\dictionarylib
  creating build\lib.win-amd64-3.9\sudachipy\plugin
  copying sudachipy\plugin\__init__.py -> build\lib.win-amd64-3.9\sudachipy\plugin
  creating build\lib.win-amd64-3.9\sudachipy\plugin\connect_cost
  copying sudachipy\plugin\connect_cost\editconnectioncost.py -> build\lib.win-amd64-3.9\sudachipy\plugin\connect_cost
  copying sudachipy\plugin\connect_cost\inhibitconnectioncost.py -> build\lib.win-amd64-3.9\sudachipy\plugin\connect_cost
  copying sudachipy\plugin\connect_cost\__init__.py -> build\lib.win-amd64-3.9\sudachipy\plugin\connect_cost
  creating build\lib.win-amd64-3.9\sudachipy\plugin\input_text
  copying sudachipy\plugin\input_text\default_input_text_plugin.py -> build\lib.win-amd64-3.9\sudachipy\plugin\input_text
  copying sudachipy\plugin\input_text\input_text.py -> build\lib.win-amd64-3.9\sudachipy\plugin\input_text
  copying sudachipy\plugin\input_text\prolongedsoundmark.py -> build\lib.win-amd64-3.9\sudachipy\plugin\input_text
  copying sudachipy\plugin\input_text\utils.py -> build\lib.win-amd64-3.9\sudachipy\plugin\input_text
  copying sudachipy\plugin\input_text\__init__.py -> build\lib.win-amd64-3.9\sudachipy\plugin\input_text
  creating build\lib.win-amd64-3.9\sudachipy\plugin\oov
  copying sudachipy\plugin\oov\mecab_oov_plugin.py -> build\lib.win-amd64-3.9\sudachipy\plugin\oov
  copying sudachipy\plugin\oov\oov_provider_plugin.py -> build\lib.win-amd64-3.9\sudachipy\plugin\oov
  copying sudachipy\plugin\oov\simple_oov_plugin.py -> build\lib.win-amd64-3.9\sudachipy\plugin\oov
  copying sudachipy\plugin\oov\utils.py -> build\lib.win-amd64-3.9\sudachipy\plugin\oov
  copying sudachipy\plugin\oov\__init__.py -> build\lib.win-amd64-3.9\sudachipy\plugin\oov
  creating build\lib.win-amd64-3.9\sudachipy\plugin\path_rewrite
  copying sudachipy\plugin\path_rewrite\join_katakana_oov_plugin.py -> build\lib.win-amd64-3.9\sudachipy\plugin\path_rewrite
  copying sudachipy\plugin\path_rewrite\join_numeric_plugin.py -> build\lib.win-amd64-3.9\sudachipy\plugin\path_rewrite
  copying sudachipy\plugin\path_rewrite\numericparser.py -> build\lib.win-amd64-3.9\sudachipy\plugin\path_rewrite
  copying sudachipy\plugin\path_rewrite\path_rewrite_plugin.py -> build\lib.win-amd64-3.9\sudachipy\plugin\path_rewrite
  copying sudachipy\plugin\path_rewrite\utils.py -> build\lib.win-amd64-3.9\sudachipy\plugin\path_rewrite
  copying sudachipy\plugin\path_rewrite\__init__.py -> build\lib.win-amd64-3.9\sudachipy\plugin\path_rewrite
  creating build\lib.win-amd64-3.9\sudachipy\resources
  copying sudachipy\resources\sudachi.json -> build\lib.win-amd64-3.9\sudachipy\resources
  copying sudachipy\resources\char.def -> build\lib.win-amd64-3.9\sudachipy\resources
  copying sudachipy\resources\rewrite.def -> build\lib.win-amd64-3.9\sudachipy\resources
  copying sudachipy\resources\unk.def -> build\lib.win-amd64-3.9\sudachipy\resources
  running build_ext
  cythoning sudachipy/latticenode.pyx to sudachipy\latticenode.c
  C:\Users\m\AppData\Local\Programs\Python\Python39\lib\site-packages\Cython\Compiler\Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: C:\Users\m\AppData\Local\Temp\pip-install-oal03kk3\sudachipy_227636af8754449b96ce8e87e2caa18e\sudachipy\latticenode.pxd
    tree = Parsing.p_module(s, pxd, full_module_name)
  cythoning sudachipy/lattice.pyx to sudachipy\lattice.c
  C:\Users\m\AppData\Local\Programs\Python\Python39\lib\site-packages\Cython\Compiler\Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: C:\Users\m\AppData\Local\Temp\pip-install-oal03kk3\sudachipy_227636af8754449b96ce8e87e2caa18e\sudachipy\lattice.pxd
    tree = Parsing.p_module(s, pxd, full_module_name)
  cythoning sudachipy/tokenizer.pyx to sudachipy\tokenizer.c
  C:\Users\m\AppData\Local\Programs\Python\Python39\lib\site-packages\Cython\Compiler\Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: C:\Users\m\AppData\Local\Temp\pip-install-oal03kk3\sudachipy_227636af8754449b96ce8e87e2caa18e\sudachipy\tokenizer.pyx
    tree = Parsing.p_module(s, pxd, full_module_name)
  building 'sudachipy.latticenode' extension
  error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
  ----------------------------------------
  ERROR: Failed building wheel for sudachipy
  Running setup.py clean for sudachipy
  Building wheel for dartsclone (setup.py) ... 
elchapo
  • 33
  • 5

1 Answers1

1

The redistributable c++ that you are seeing are neccessary installations to run applications. What you need are build tools, i.e. a compiler, which - as the error message states - you can get from https://visualstudio.microsoft.com/visual-cpp-build-tools/

Alternatively, if you don't want to go through the trouble of compiling c code on your windows machine, you can look for compatible whl packages. In you case there is a pre-release of sudachiPy which has whl files for python 3.9, so you can do

pip install SudachiPy --pre

which should not need a compiler present to be installed

FlyingTeller
  • 17,638
  • 3
  • 38
  • 53