Disable import sorting when using Python 2.7
See original GitHub issueError 2020-09-25 10:55:48: runpy.run_path(module, run_name="__main__")
File "C:\Python27\lib\runpy.py", line 252, in run_path
return _run_module_code(code, init_globals, run_name, path_name)
File "C:\Python27\lib\runpy.py", line 82, in _run_module_code
mod_name, mod_fname, mod_loader, pkg_name)
File "C:\Python27\lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "c:\Users\<USER>\.vscode\extensions\ms-python.python-2020.9.111407\pythonFiles\sortImports.py", line 12, in <module>
import isort.main
File "c:\Users\<USER>\.vscode\extensions\ms-python.python-2020.9.111407\pythonFiles\lib\python\isort\__init__.py", line 2, in <module>
from . import settings
File "c:\Users\<USER>\.vscode\extensions\ms-python.python-2020.9.111407\pythonFiles\lib\python\isort\settings.py", line 31
FILE_SKIP_COMMENTS: Tuple[str, ...] = (
^
SyntaxError: invalid syntax
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:8 (3 by maintainers)
Top Results From Across the Web
How to turn off Sort Imports for a selection of files, glob or ...
Currently, you can't turn off import sorting an a per-module level through a VS Code-specific ...
Read more >Programming FAQ — Python 3.11.1 documentation
How do I share global variables across modules? What are the “best practices” for using import in a module? Why are default values...
Read more >sort-imports - ESLint - Pluggable JavaScript Linter
This rule checks all import declarations and verifies that all imports are first sorted by the used member syntax and then alphabetically by...
Read more >Configuration options for isort
Tells isort to set the known standard library based on the specified Python version. Default is to assume any Python 3 version could...
Read more >Sorting Algorithms in Python
Sorting is a basic building block that many other algorithms are built upon. ... 1from random import randint 2from timeit import repeat 3...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi, I encountered this issue as well while using Python 2.7.17. For me, the workaround is to set
python.sortImports.path
explicitly insettings.json
.In project directory, edit the VS code configuration file (
.vscode/settings.json
).We no longer support Python 2.7 as its reached its EOL, hence closing this.