【发布时间】:2021-09-29 19:29:37
【问题描述】:
我正在尝试为 Python 的 ATOM 设置我的环境。我在以前的 PC 上做过这个,并没有遇到太大的麻烦,但这次我相信有些事情搞砸了,我不知道如何修复它。
Linter-flake8 安装:
我是这样安装的:
settings --> install --> search packages --> linter-flake8 --> install.
之后会自动安装依赖项。
然后我运行 CMD 并使用以下命令安装 flake8:
py -m pip install flake8
当我尝试在 ATOM 中输入我的代码时;我收到此错误:
[Linter] Error running Flake8 Error: Failed to spawn command `flake8`. Make sure `flake8` is installed and on your PATH
at C:\Users\yazan\.atom…\lib\helpers.js:130
(anonymous) @ C:\Users\yazan\.atom…ter\dist\index.js:1
我尝试解决的问题:
- 将 ATOM 添加到我的路径中,我做了但没有奏效(ATOM 和 Python 都在我的用户和系统、环境变量中)
- 检查我的 ATOM 是否运行相同版本的 python。
import sys print(sys.version)
3.9.7 (tags/v3.9.7:1016ef3, Aug 30 2021, 20:19:38) [MSC v.1929 64 bit (AMD64)]
- 在 CMD 中检查了我的 linter-flake8 的安装路径:
结果 -->
C:\Users\yazan>py -m pip install flake8
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: flake8 in c:\users\yazan\appdata\roaming\python\python39\site-packages (3.9.2)
Requirement already satisfied: mccabe<0.7.0,>=0.6.0 in
c:\users\yazan\appdata\roaming\python\python39\site-packages (from flake8) (0.6.1)
Requirement already satisfied: pyflakes<2.4.0,>=2.3.0 in
c:\users\yazan\appdata\roaming\python\python39\site-packages (from flake8) (2.3.1)
Requirement already satisfied: pycodestyle<2.8.0,>=2.7.0 in
c:\users\yazan\appdata\roaming\python\python39\site-packages (from flake8) (2.7.0)
我的想法用完了,搜索了很多,但不知道如何解决这个问题。
谢谢!
【问题讨论】:
标签: python pip atom-editor flake8 linter