vscode-python: "write EPIPE" error when running "Python Refactor: Sort Imports"
Environment data
- VS Code version: Version: 1.48.0-insider
- Extension version (available under the Extensions sidebar): v2020.7.94776
- OS and version: MacOS 10.14.6 (AMD hackintosh if that matters)
- Python version (& distribution if applicable, e.g. Anaconda): Python 3.8.2
- Type of virtual environment used (N/A | venv | virtualenv | conda | …): virtualenv
- Relevant/affected Python packages and their versions: isort 4.3.21
- Relevant/affected Python-related VS Code extensions and their versions: N/A
- Value of the
python.languageServer
setting: Jedi
Expected behaviour
Given input file main.py
:
from typing import List, Optional
from datetime import datetime
print("Hello World")
Using the python extension’s “Python Refactor: Sort Imports” command, it should rearrange the imports in alphabetical order to the following:
from datetime import datetime
from typing import List, Optional
print("Hello World")
Actual behaviour
After pressing cmd+shift+P
and selecting “Python Refactor: Sort Imports”, I get this little error popup saying “write EPIPE” (see image).
NOTE: this works properly when runningisort main.py
manually from the terminal
Steps to reproduce:
./.vscode/settings.json
{
"python.pythonPath": "venv/bin/python",
"python.sortImports.path": "isort"
}
- create file main.py above
- create a virtual environment -
virtualenv venv
- activate virtual environment -
source venv/bin/activate
- install isort dependency -
pip install isort
- Open command palette (
cmd+shift+P
on mac) - Search “Python Refactor: Sort Imports” and select the correct command
- Press Enter
Logs
N/A
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 16
@jaklan @hkennyv This is a duplicate of https://github.com/microsoft/vscode-python/issues/7042. The error message is different from one before because we changed how we’re running isort, but it’s the same issue.
@hkennyv it’s not a mistake - this is an error,
"python.sortImports.path": "isort"
should work the same way theisort
command works within virtualenv (and for other tools like e.g.black
that’s working with no problem).