sphinx-contrib / sphinx-pretty-searchresults

Sphinx: pretty search results is an extension for the Sphinx documentation tool. To display search results, Sphinx is fetching the source files of search hits and rendering excerpts in raw markup. This extension removes the markup from these source files (during build time), so the search results look decent.
https://pypi.python.org/pypi/sphinxprettysearchresults
MIT License
22 stars 5 forks source link

No such file or directory: 'sphinx-build' #20

Open ghost opened 6 years ago

ghost commented 6 years ago

Exception when running make html Works fine without extensions = ['sphinxprettysearchresults'] in conf.py

$ make html
Running Sphinx v1.6.3
loading pickled environment... done
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 41 source files that are out of date
updating environment: [extensions changed] 41 added, 0 changed, 0 removed
reading sources... [100%] using_this_guide                                                                                                                                           
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] using_this_guide                                                                                                                                            
generating indices... genindex
writing additional pages... search
copying downloadable files... [100%] Paua.pdf                                                                                                                                        
copying static files... done
copying extra files... done
dumping search index in English (code: en) ... done
dumping object inventory... done
build succeeded.

Exception occurred:
  File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 1333, in _execute_child
    raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'sphinx-build'
The full traceback has been saved in /var/folders/hv/jfctz5f52s3f1yzl4x9r9qc80000gn/T/sphinx-err-cqf17lxq.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!
make: *** [html] Error 1

The contents of the logfile are:

# Python version: 3.6.2 (CPython)
# Docutils version: 0.13.1 release
# Jinja2 version: 2.9.6
# Last messages:
#   dumping search index in English (code: en) ...
#   
#   done
#   
#   dumping object inventory...
#   
#   done
#   
#   build succeeded.
#   
# Loaded extensions:
#   alabaster (0.7.10) from /usr/local/lib/python3.6/site-packages/alabaster/__init__.py
#   sphinxprettysearchresults (unknown version) from /usr/local/lib/python3.6/site-packages/sphinxprettysearchresults/__init__.py
Traceback (most recent call last):
  File "/Users/george/Library/Python/3.6/lib/python/site-packages/sphinx/cmdline.py", line 306, in main
    app.build(opts.force_all, filenames)
  File "/Users/george/Library/Python/3.6/lib/python/site-packages/sphinx/application.py", line 357, in build
    self.emit('build-finished', None)
  File "/Users/george/Library/Python/3.6/lib/python/site-packages/sphinx/application.py", line 489, in emit
    return self.events.emit(event, self, *args)
  File "/Users/george/Library/Python/3.6/lib/python/site-packages/sphinx/events.py", line 79, in emit
    results.append(callback(*args))
  File "/usr/local/lib/python3.6/site-packages/sphinxprettysearchresults/__init__.py", line 51, in build_search_snippets
    clean_txts(app.config.language, app.srcdir, app.outdir, source_suffix, app.config.use_old_search_snippets)
  File "/usr/local/lib/python3.6/site-packages/sphinxprettysearchresults/__init__.py", line 34, in clean_txts
    srcdir, sources_build_path])
  File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 707, in __init__
    restore_signals, start_new_session)
  File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 1333, in _execute_child
    raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'sphinx-build'
TimKam commented 6 years ago

Thanks for reporting. Can you point to your Sphinx project's code or - even better - provide a minimal working example?

ghost commented 6 years ago

Minimal project attached.

user_guide.zip

TimKam commented 6 years ago

I see. Sphinx: pretty search results assumes the sphinx-build command is available on your command line. This is probably not the case on your machine. If you fix this, the build should work. Can you confirm?

ghost commented 6 years ago

sphinx-build appears to be present and correct:

$ sphinx-build -h
Sphinx v1.6.3
Usage: sphinx-build [options] sourcedir outdir [filenames...]

Filename arguments:
  without -a and without filenames, write new and changed files.
  with -a, write all files.
  with filenames, write these.

Options:
  -h, --help          show this help message and exit
  --version           show version information and exit

  General options:
    -b BUILDER        builder to use; default is html
    -a                write all files; default is to only write new and
                      changed files
    -E                don't use a saved environment, always read all files
    -d PATH           path for the cached environment and doctree files
                      (default: outdir/.doctrees)
    -j N              build in parallel with N processes where possible

  Build configuration options:
    -c PATH           path where configuration file (conf.py) is located
                      (default: same as sourcedir)
    -C                use no config file at all, only -D options
    -D setting=value  override a setting in configuration file
    -A name=value     pass a value into HTML templates
    -t TAG            define tag: include "only" blocks with TAG
    -n                nit-picky mode, warn about all missing references

  Console output options:
    -v                increase verbosity (can be repeated)
    -q                no output on stdout, just warnings on stderr
    -Q                no output at all, not even warnings
    --color           Do emit colored output (default: auto-detect)
    -N, --no-color    Do not emit colored output (default: auot-detect)
    -w FILE           write warnings (and errors) to given file
    -W                turn warnings into errors
    -T                show full traceback on exception
    -P                run Pdb on exception

For more information, visit <http://sphinx-doc.org/>.