Installing spacy_readability in jupyter notebook

Question:

I am trying to use spacy and some related packages in jupyter

!pip install spacy --user

works fine, but

!pip install spacy_readability --user

results in the error:

ERROR: Command errored out with exit status 1:
   command: 'C:ProgramDataAnaconda3python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Desktop PC\AppData\Local\Temp\pip-install-5abs2tnd\ujson_1413fc5067b64d23bce53331a88761c9\setup.py'"'"'; __file__='"'"'C:\Users\Desktop PC\AppData\Local\Temp\pip-install-5abs2tnd\ujson_1413fc5067b64d23bce53331a88761c9\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:UsersDesktop PCAppDataLocalTemppip-wheel-vccpv_5b'
       cwd: C:UsersDesktop PCAppDataLocalTemppip-install-5abs2tndujson_1413fc5067b64d23bce53331a88761c9
  Complete output (6 lines):
  Warning: 'classifiers' should be a list, got type 'filter'
  running bdist_wheel
  running build
  running build_ext
  building 'ujson' 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 ujson
    ERROR: Command errored out with exit status 1:
     command: 'C:ProgramDataAnaconda3python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Desktop PC\AppData\Local\Temp\pip-install-5abs2tnd\ujson_1413fc5067b64d23bce53331a88761c9\setup.py'"'"'; __file__='"'"'C:\Users\Desktop PC\AppData\Local\Temp\pip-install-5abs2tnd\ujson_1413fc5067b64d23bce53331a88761c9\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:UsersDesktop PCAppDataLocalTemppip-record-s9u60ttfinstall-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:UsersDesktop PCAppDataRoamingPythonPython38Includeujson'
         cwd: C:UsersDesktop PCAppDataLocalTemppip-install-5abs2tndujson_1413fc5067b64d23bce53331a88761c9
    Complete output (6 lines):
    Warning: 'classifiers' should be a list, got type 'filter'
    running install
    running build
    running build_ext
    building 'ujson' 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: Command errored out with exit status 1: 'C:ProgramDataAnaconda3python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Desktop PC\AppData\Local\Temp\pip-install-5abs2tnd\ujson_1413fc5067b64d23bce53331a88761c9\setup.py'"'"'; __file__='"'"'C:\Users\Desktop PC\AppData\Local\Temp\pip-install-5abs2tnd\ujson_1413fc5067b64d23bce53331a88761c9\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:UsersDesktop PCAppDataLocalTemppip-record-s9u60ttfinstall-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:UsersDesktop PCAppDataRoamingPythonPython38Includeujson' Check the logs for full command output.

any idea how to

Asked By: Abijah

||

Answers:

You are probably missing ujson.

To install spacy-readability:

building and creating wheel for ujson is needed.

Here is a screenshot from my notebook, when I tried to install spacy-readability

enter image description here

Also, from the error messages it looks like you need Microsoft Visual C++ 14.0 or greater if you have an older version.

To install ujson try !pip install ujson

Answered By: God Is One