【问题标题】:Atom can't spawn Flake8 on Windows 10Atom 无法在 Windows 10 上生成 Flake8
【发布时间】:2017-02-03 01:03:18
【问题描述】:

当我尝试在 Windows 10 上使用带有 linter-flake8 包的 Atom 时遇到错误:

Error: spawn flake8 ENOENT
    at getENOENTError (C:\Users\ME\.atom\packages\linter-flake8\node_modules\sb-exec\lib\helpers.js:159:15)
    at ChildProcess.<anonymous> (C:\Users\ME\.atom\packages\linter-flake8\node_modules\sb-exec\lib\index.js:50:46)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:877:16)
    at Socket.<anonymous> (internal/child_process.js:334:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:493:12)

我假设这是因为我使用 WSL 来设置基本上是我的 Ubuntu Python 开发环境的副本 - pyenv、virtualenv、git,并且我在 virtualenvs 中安装了 flake8,因为我使用不同的 Python版本。

我通常从项目的 virtualenv 中启动 Atom,但由于我必须从 Windows 上的 Bash 外部启动 Atom,我认为它不知道我已经安装了 flake8。

我说的对吗?我对解决方案的第一个想法是在系统范围内安装 flake8,然后让 linter-flake8 指向它,但这似乎是一种麻烦的方法。我应该如何解决这个问题?

【问题讨论】:

  • Atom 找不到 Flake8 可执行文件是正确的。我相信 linter-flake8 允许您指定 python 可执行文件的路径,尽管它们应该用来执行python -m flake8
  • 我检查了,它只有一个选项来指定 flake8 的路径,而不是 python。
  • 我认为这是这个问题的重复:stackoverflow.com/questions/50654434/…>

标签: python windows windows-subsystem-for-linux flake8


【解决方案1】:

查看 linter-flake8 的来源,看来您可以设置 executablePath

这需要在您每次启动时进行配置。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-11-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-10-18
    • 2018-05-30
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多