-
-
Notifications
You must be signed in to change notification settings - Fork 43
Arguments get passed to Node when launched from Python Interactive in VSCode #149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @Clocktown, I am able to reproduce this on MacOS, and you're right that it's a really weird issue. I think I tracked down the culprit. I started by dumping out all of the environment variables that are set in the VSCode/Python Interactive session: import os
print('\n'.join(os.environ))
And the print(os.environ['ELECTRON_RUN_AS_NODE'])
Here are the docs that I could find for it https://electronjs.org/docs/api/environment-variables#electron_run_as_node
If I delete this environment variable, all is well: del os.environ['ELECTRON_RUN_AS_NODE']
import subprocess
res = subprocess.run(
args=['/Applications/orca.app/Contents/MacOS/orca', '--help'],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
print(res.stdout.decode())
I don't really know what this variable is for, so I don't know if deleting it is going to break something else in VSCode. plotly.py already clears the Any thoughts @rchiodo? |
@jonmmease Thanks for your detailed comment! |
Closing in favor of plotly/plotly.py#1293 and https://github.com/Microsoft/vscode-python/issues/3455 since the issue is out of the control of orca itself (when |
System Info
Windows 10 Pro 64 Bit
Anaconda3, Python 3.7, 64 Bit
orca installed through conda
Expected behaviour
Running orca using Python
subprocess
module actually runs orca.Actual behaviour
Arguments are passed to node instead, but only if run inside a Visual Studio Code "Python Interactive" Pane (Jupyter Server), and in no other situation.
Long Version
I have a very weird issue, and it might not be orca's fault at all, but I'm still posting this looking for clues.
When I run the following python code:
It works fine if run in a regular Python REPL, if run as a file with Python, through a
jupyter notebook
orjupyter qtconsole
. It works, as it should. But if I open a "Python Interactive" Pane in Visual Studio Code (through their Python extension) -- which runs a Jupyter Server anyways -- this command will instead invoke what appears to benode --help
. I tried different arguments, and I always get output as if I'd have launchednode
instead of orca. This unfortunately breaks theplotly.io
capabilities, as long as it's run in this Interactive Pane. Note that I could not reproduce this with other executables, e.g. launching VS Code itself like this does what it is supposed to.My guess is that some sketchy electron/node stuff happens here. Both VSCode and orca use electron after all. But as I already mentioned, if I launch Code itself with this, it works. I could only produce this problem with orca.
I will also post an issue at the VSCode Python extension GitHub, as I really have no clue what is at fault here.
Edit: Related issue: https://github.com/Microsoft/vscode-python/issues/3455
The text was updated successfully, but these errors were encountered: