"write EPIPE" error when running "Python Refactor: Sort Imports"
See original GitHub issueEnvironment 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
Issue Analytics
- State:
- Created 3 years ago
- Comments:16
Top Results From Across the Web
VS Code's "Sort Imports" fails with exception - Stack Overflow
I've updated the full stack trace. Steps to reproduce: 1. Open a python script with multiple import lines 2. Open command palette 3....
Read more >Error: write EPIPE - Scripting - McNeel Forum
The problem is that when I run a python file from within VS, I get the “Error: write EPIPE”. Here is what happens...
Read more >While running post-startup callbacks: error: write EPIPE after ...
Easiest solution is to refactor the function into a separate file without the blaze dependency which both server and client can import.
Read more >Changelog - Sphinx documentation
Now Sphinx installs them on running application. sphinx.ext.autodoc crashes if target code imports * from mock modules by autodoc_mock_imports .
Read more >2011-March.txt - Python mailing list
2011) | 4 lines Recommend inspecting the errno attribute of socket.error objects, ... buffering=0) + try: + f.seek(0x80000001) + f.write(b'x') + f.flush() + ......
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 Free
Top 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
@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).