sphinx subprocess.py FileNotFoundError: [WinError 2] 系统找不到指定的文件。

运行python ./doc/scripts/docgen.py时出现以下错误。

# Sphinx version: 1.3.1
# Python version: 3.5.2 (CPython)
# Docutils version: 0.12 release
# Jinja2 version: 2.8
# Last messages:
#   reading sources... [  4%] cifarSC2011/pyCUDA
#   reading sources... [  5%] cifarSC2011/theano
#   reading sources... [  5%] citation
#   reading sources... [  6%] core_development_guide
#   reading sources... [  6%] crei2013/advanced_theano
#   reading sources... [  7%] crei2013/gpundarray
#   reading sources... [  8%] crei2013/index
#   reading sources... [  8%] crei2013/introduction
#   reading sources... [  9%] crei2013/theano
#   reading sources... [  9%] dev_start_guide
# Loaded extensions:
#   sphinx.ext.doctest (1.3.1) from C:IntelPython35libsite-packagessphinxextdoctest.py
#   alabaster (0.7.9) from C:IntelPython35libsite-packagesalabaster\__init__.py
#   sphinx.ext.autodoc (1.3.1) from C:IntelPython35libsite-packagessphinxextautodoc.py
#   sphinx.ext.pngmath (1.3.1) from C:IntelPython35libsite-packagessphinxextpngmath.py
#   sphinx.ext.linkcode (1.3.1) from C:IntelPython35libsite-packagessphinxextlinkcode.py
#   sphinx.ext.napoleon (1.3.1) from C:IntelPython35libsite-packagessphinxext
apoleon\__init__.py
#   sphinx.ext.todo (1.3.1) from C:IntelPython35libsite-packagessphinxext	odo.py
Traceback (most recent call last):
  File "C:IntelPython35libsite-packagessphinxcmdline.py", line 245, in main
    app.build(opts.force_all, filenames)
  File "C:IntelPython35libsite-packagessphinxapplication.py", line 264, in build
    self.builder.build_update()
  File "C:IntelPython35libsite-packagessphinxuilders\__init__.py", line 245, in build_update
    'out of date' % len(to_build))
  File "C:IntelPython35libsite-packagessphinxuilders\__init__.py", line 259, in build
    self.doctreedir, self.app))
  File "C:IntelPython35libsite-packagessphinxenvironment.py", line 618, in update
    self._read_serial(docnames, app)
  File "C:IntelPython35libsite-packagessphinxenvironment.py", line 638, in _read_serial
    self.read_doc(docname, app)
  File "C:IntelPython35libsite-packagessphinxenvironment.py", line 810, in read_doc
    app.emit('doctree-read', doctree)
  File "C:IntelPython35libsite-packagessphinxapplication.py", line 497, in emit
    results.append(callback(self, *args))
  File "C:IntelPython35libsite-packagessphinxextlinkcode.py", line 57, in doctree_read
    uri = resolve_target(domain, info)
  File "conf.py", line 219, in linkcode_resolve
    universal_newlines=True).communicate()[0][:-1]
  File "C:IntelPython35libsubprocess.py", line 947, in __init__
    restore_signals, start_new_session)
  File "C:IntelPython35libsubprocess.py", line 1224, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] 系统找不到指定的文件。

原因是git没有加入环境变量中,将其目标加入到环境变量中就可以了。

原文地址:https://www.cnblogs.com/corfox/p/6144729.html