vscode autopep8不运行

2024-05-20 08:08:08 发布

您现在位置:Python中文网/ 问答频道 /正文

我刚在vscode中运行autopep8,系统报告了两个错误:

Error: Command failed: autopep8 c:\Users\Administrator\Desktop\Python\从入门到实践\have a try\5-10.py usage: autopep8 [-h] [--version] [-v] [-d] [-i] [--global-config filename] [--ignore-local-config] [-r] [-j n] [-p n] [-a] [--experimental] [--exclude globs] [--list-fixes] [--ignore errors] [--select errors] [--max-line-length n] [--line-range line line] [--hang-closing] [--exit-code] [files [files ...]] autopep8: error: autopep8 only takes one filename as argument unless the "--in-place" or "--diff" args are used

以及

usage: autopep8 [-h] [--version] [-v] [-d] [-i] [--global-config filename] [--ignore-local-config] [-r] [-j n] [-p n] [-a] [--experimental] [--exclude globs] [--list-fixes] [--ignore errors] [--select errors] [--max-line-length n] [--line-range line line] [--hang-closing] [--exit-code] [files [files ...]] autopep8: error: autopep8 only takes one filename as argument unless the "--in-place" or "--diff" args are used

有人知道为什么吗?我尽力了,但也不知道该怎么办。在

我正在使用:

Extension:Python-autopep8

vscode:1.33.1


Tags: configversionlocallineusagefilesfilenamevscode
1条回答
网友
1楼 · 发布于 2024-05-20 08:08:08

在终端中,您可以将目录指向文件所在的位置。然后使用以下命令:

autopep8  in-place  aggressive  aggressive <filename>

例如:

^{pr2}$

通常,当您在VScode中使用终端时。你的目录已经存在,它应该在哪里。除非你的文件在子文件夹中。在

您需要的一切都可以在https://pypi.org/project/autopep8/找到

相关问题 更多 >