AREPL-vscode icon indicating copy to clipboard operation
AREPL-vscode copied to clipboard

TypeError Cannot read property 'setEncoding' of undefined

Open Almenon opened this issue 6 years ago • 5 comments


TypeError: Cannot read property 'setEncoding' of undefined 	at /Users/anon/.vscode/extensions/almenon.arepl-1.0.14/node_modules/python-shell/index.js:99:39 
	at Array.forEach (<anonymous>) 	
at new PythonShell (/Users/anon/.vscode/extensions/almenon.arepl-1.0.14/node_modules/python-shell/index.js:97:39)
 	at PythonEvaluator.startPython (/Users/anon/.vscode/extensions/almenon.arepl-1.0.14/node_modules/arepl-backend/index.js:111:24) 	
at PreviewManager.startAndBindPython (/Users/anon/.vscode/extensions/almenon.arepl-1.0.14/out/src/PreviewManager.js:153:34) 	
at PreviewManager.<anonymous> (/Users/anon/.vscode/extensions/almenon.arepl-1.0.14/out/src/PreviewManager.js:52:18) 	
at Generator.next (<anonymous>) 	
at __awaiter (/Users/anon/.vscode/extensions/almenon.arepl-1.0.14/out/src/PreviewManager.js:7:71) 	at new Promise (<anonymous>) 	at __awaiter (/Users/anon/.vscode/extensions/almenon.arepl-1.0.14/out/src/PreviewManager.js:3:12) 	at PreviewManager.startArepl (/Users/anon/.vscode/extensions/almenon.arepl-1.0.14/out/src/PreviewManager.js:40:16) 
	at vscode.commands.registerCommand (/Users/anon/.vscode/extensions/almenon.arepl-1.0.14/out/src/extension.js:12:24) 	at d._executeContributedCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:477:621) 	

If you run into this issue please let me know what python path you have configured.

Almenon avatar May 03 '19 05:05 Almenon

I've only seen this happen on Darwin 18.2.0 OS so far

Almenon avatar May 03 '19 05:05 Almenon

I am getting this error too. Fresh install of Anaconda and VS Code on a mac. Installed the AREPL extension and I get the following error in a new document window:

Error running python with command: /Users/anon/anaconda3 -u
TypeError: Cannot read property 'setEncoding' of undefined
	at /Users/anon/.vscode/extensions/almenon.arepl-1.0.16/node_modules/python-shell/index.js:99:39
	at Array.forEach (<anonymous>)
	at new PythonShell (/Users/anon/.vscode/extensions/almenon.arepl-1.0.16/node_modules/python-shell/index.js:97:39)
	at python_evaluator.start (/Users/anon/.vscode/extensions/almenon.arepl-1.0.16/node_modules/arepl-backend/index.js:112:24)
	at PreviewManager.startAndBindPython (/Users/anon/.vscode/extensions/almenon.arepl-1.0.16/out/src/PreviewManager.js:146:35)
	at PreviewManager.<anonymous> (/Users/anon/.vscode/extensions/almenon.arepl-1.0.16/out/src/PreviewManager.js:54:18)
	at Generator.next (<anonymous>)
	at __awaiter (/Users/anon/.vscode/extensions/almenon.arepl-1.0.16/out/src/PreviewManager.js:7:71)
	at new Promise (<anonymous>)
	at __awaiter (/Users/anon/.vscode/extensions/almenon.arepl-1.0.16/out/src/PreviewManager.js:3:12)
	at PreviewManager.startArepl (/Users/anon/.vscode/extensions/almenon.arepl-1.0.16/out/src/PreviewManager.js:40:16)
	at vscode.commands.registerCommand.vscodeUtilities_1.default.newUnsavedPythonDoc.then (/Users/anon/.vscode/extensions/almenon.arepl-1.0.16/out/src/extension.js:17:42)

Print Output:```

kartzke avatar Jul 13 '19 13:07 kartzke

Thanks for giving me the python path - For some reason one of 'stdout', 'stdin', 'stderr' is null after spawning the process and I'm not sure why. I just have a windows laptop at the moment but once I get back home I'll be able to test python paths on my ubuntu VM. In the meantime I would suggest using python3 instead of anaconda for AREPL if possible. AREPL doesn't support anaconda very well because the anaconda environment needs to be activated to work properly.

Almenon avatar Jul 14 '19 05:07 Almenon

Thanks, I’ll give it a try!

kartzke avatar Jul 17 '19 13:07 kartzke

note to self: https://github.com/extrabacon/python-shell/pull/191 might change the error - I'm guessing when that gets merged in the error would be "stdin not open for writting"

Almenon avatar Aug 02 '19 15:08 Almenon