AREPL-vscode
AREPL-vscode copied to clipboard
ERR_STREAM_DESTROYED when using ARPEL with pipenv
Describe the bug Error ERR_STREAM_DESTROYED occurs when trying to use ARPEL with pipenv.
To Reproduce
- Create pipenv environment
- Point python interpreter to pipenv
- Start typing
- See error
Expected behavior Automatically evaluates python code in real-time
Error message When using 'afterDelay' as trigger
`internal arepl error: Error stack: Error [ERR_STREAM_DESTROYED]: Cannot call write after a stream was destroyed at doWrite (_stream_writable.js:399:19) at writeOrBuffer (_stream_writable.js:387:5) at Socket.Writable.write (_stream_writable.js:318:11) at PythonShell.send (c:\Users\anon.vscode\extensions\almenon.arepl-2.0.1\node_modules\python-shell\index.js:285:20) at PythonEvaluator.execCode (c:\Users\anon.vscode\extensions\almenon.arepl-2.0.1\node_modules\arepl-backend\index.js:71:22) at ToAREPLLogic.onUserInput (c:\Users\anon.vscode\extensions\almenon.arepl-2.0.1\out\src\toAREPLLogic.js:80:34) at PreviewManager.onAnyDocChange (c:\Users\anon.vscode\extensions\almenon.arepl-2.0.1\out\src\PreviewManager.js:278:51) at listOnTimeout (internal/timers.js:551:17) at processTimers (internal/timers.js:492:7)
Print Output:
Traceback (most recent call last):
File "c:\Users<username>.vscode\extensions\almenon.arepl-2.0.1\node_modules\arepl-backend\python\arepl_python_evaluator.py", line 329, in
When using 'onSave' as trigger
`internal arepl error: Error stack: Error [ERR_STREAM_DESTROYED]: Cannot call write after a stream was destroyed
at doWrite (_stream_writable.js:399:19)
at writeOrBuffer (_stream_writable.js:387:5)
at Socket.Writable.write (_stream_writable.js:318:11)
at PythonShell.send (c:\Users\anon.vscode\extensions\almenon.arepl-2.0.1\node_modules\python-shell\index.js:285:20)
at PythonEvaluator.execCode (c:\Users\anon.vscode\extensions\almenon.arepl-2.0.1\node_modules\arepl-backend\index.js:71:22)
at ToAREPLLogic.onUserInput (c:\Users\anon.vscode\extensions\almenon.arepl-2.0.1\out\src\toAREPLLogic.js:80:34)
at PreviewManager.onAnyDocChange (c:\Users\anon.vscode\extensions\almenon.arepl-2.0.1\out\src\PreviewManager.js:278:51)
at PreviewManager.
Print Output:
Traceback (most recent call last):
File "c:\Users<username>.vscode\extensions\almenon.arepl-2.0.1\node_modules\arepl-backend\python\arepl_python_evaluator.py", line 329, in
Other Information:
- OS: Windows10
- Python Version 3.7.2
- VSCode Version 1.53.2
- ARPEL Version v2.0.1
Additional context
- python.pythonPath is set to "C:\Users\
\.virtualenvs\Test_Project-Sy3-GYB1\Scripts\python.exe" - I also tried setting AREPL.pythonPath to the same path, did not change anything
- When python for ARPEL is set to system python it works. However, modules can not be found as they are only in pipenv
Thanks for reporting the issue, what version of python are you using for pipenv? You can find out the version with python --version
Ooops you specified tha already, nevermind. Python 3.7 should work...
I wasn't able to reproduce this on windows 10 w/ python version 3.7.1, pipenv version 2020.11.15, arepl 2.0.1 (same version), and vscode 1.53.2 (same version)
it looks like you have a extra slash in your path, maybe try removing that?
C:\Users\\.virtualenvs\Test_Project-Sy3-GYB1\Scripts\python.exe
^
Thanks for your reply.
I actually have double backslashes everywhere ("C:\\Users\\<username>\\.virtualenvs\\Test_Project-Sy3-GYB1\\Scripts\\python.exe"). They are seen as escape character otherwise. They were removed when copying except for the one followed by the dot... ah no, there should have been "<username>" in between there which I forgot.
Edit: Ok. I did not forget anything... it's seen as formatting here... here we go.
So, I did the following:
- Installed python 3.7.9 over the 3.7.2 one. -> python --version within the venv in vscode showd 3.7.9 without changing anything in the venv- -> error still occurred
- Install python 3.8.7 -> had to update Pipfile to 3.8 and recreate venv for 3.8.7 -> everything worked fine
- Changed Pipfile back to 3.7 and recreated venv for 3.7.9 -> everything worked fine
- Removed python 3.7.9 and reinstalled 3.7.2 -> recreate venv for 3.7.2 -> same error as before
To me it seems there is an issue with python 3.7.2.
I tried 3.7.2 and it works for me. Can you try 3.7.2 without the venv?
Yes. Without pipenv it works fine. I mentioned that on my first post, but did not formulate this clearly 😏 .