VSCode에서 autopep8에서 문제 해결 방안을 실행할 수 없음(Error: Command failed, usage 알림)

2160 단어 VSCodeautopep8
오류 현상: autopep8을 실행할 수 없습니다. 실행 후 vscode 오른쪽 아래 알림
오류: Command failed: autopep8 c:\Users\Administrator\Desktop\Python\제1장 개요\1-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
오류 원인:
파일 경로에 공백이 포함되어 있습니다!

VSCode에서 autopep8 플러그인 실행 오류 문제 해결 (플러그인 실행, 코드 포맷 없음)


문제현상: autopep8을 실행한 후 플러그인이 정상적으로 실행되고 있음을 알렸지만 코드는 아무런 변화가 없습니다.
문제 해결 프로세스:
1. 우선 명령줄에서 autopep8 파일 경로를 사용합니다.py가 테스트를 진행합니다. 실행 후 명령줄에 모든 코드가 표시되지만 문서를 포맷하지 않았습니다.
2. autopep8을 실행하는 명령 도움말과 네트워크 조회에 따라 알 수 있듯이 autopep8을 실행할 때 --in-place--aggressive 파라미터를 추가해야 한다
명령 형식은 autopep8 --in-place --aggressive 파일 경로 이름입니다.py
명령줄에서 autopep8 문제 해결을 실행합니다!
3. 어떻게 VSCode에서 autopep8에 파라미터를 추가합니까?
preference>setting에서 autopep8Args를 설정하려고 했지만 무효입니다!
파일을 검색하여 C:\Users\Administrator\.vscode\extensions\himanoa.python-autopep8-1.0.2 디렉터리, 즉 확장 설치 디렉터리입니다.
확장을 엽니다.js 파일.
찾다

 exec('autopep8 ' + filename, function(error, stdout, stderr){
로 수정

 exec('autopep8 --in-place --aggressive ' + filename, function(error, stdout, stderr){
VSCode 재부팅, 문제 해결!
VSCode에서 autopep8이 실행되지 않는 문제 해결 방안 (알림 Error: Command failed, usage) 에 대한 이 글은 여기에 소개되었습니다. 더 많은 관련 VSCode autopep8이 실행되지 않는 내용은 이전의 글을 검색하거나 아래의 관련 글을 계속 훑어보십시오. 앞으로 많은 응원 부탁드립니다!

좋은 웹페이지 즐겨찾기