Error: spawn pycodestyle ENOENT

Error: spawn pycodestyle ENOENT

我在安装 linter-pep8 时遇到了这个错误。

Error: spawn pycodestyle ENOENT
at exports._errnoException (util.js:1026:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
at onErrorNT (internal/child_process.js:359:16)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)

错误是由于软件包从 linter-pep8 重命名为 linter-pycodestyle v2.0.0

解决方案:

  1. 卸载 pep8 sudo pip uninstall pep8
  2. 卸载 pycodestyle sudo pip uninstall pycodestyle
  3. 再次安装 pycodestyle sudo pip install pycodestyle
  4. 卸载 ATOM linter-pep8apm uninstall linter-pep8
  5. 正在安装 ATOM linter-pycodestyleapm install linter-pycodestyle
  6. 通过在终端中执行 which pycodestyle 检查 pycodestyle 是否正确安装。它应该 return pycodestyle 的路径(例如 /usr/local/bin/pycodestyle)。您可以在原子的 linter-pycodestyle 包的 可执行路径 设置中设置此路径 - 但它应该默认工作