Skip to content

Activating to run Jupyter failed #11862

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

Closed
opoloko opened this issue May 16, 2020 · 7 comments
Closed

Activating to run Jupyter failed #11862

opoloko opened this issue May 16, 2020 · 7 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster

Comments

@opoloko
Copy link

opoloko commented May 16, 2020

Bug: Notebook Editor, Interactive Window, Editor cells

Steps to cause the bug to occur

  1. open any notebook or create any notebook

Actual behavior

Jupyter server disconnected/not started

Expected behavior

Jupyter server started and ready (as it happens on my local VSC)

Your Jupyter and/or Python environment

Please provide as much info as you readily know

Remote code-server (latest version), on Linux Centos7, Python3 installed and working 3.6.8, conda installed, Jupyter Notebook server installed on same machine and working.

Developer Tools Console Output

Cannot activate it, but I get the error from Python extension saying:

Activating Python 3.6.8 64-bit to run Jupyter failed with Error: StdErr from ShellExec, stdin: is not a tty for . /usr/bin/activate && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python /var/lib/code-server2/extensions/ms-python.python-2020.5.78807/pythonFiles/pyvsc-run-isolated.py /var/lib/code-server2/extensions/ms-python.python-2020.5.78807/pythonFiles/printEnvVariables.py

If I run the command manually in a VSC terminal it works (from /usr/bin/activate up all the way to Variables.py).

Screenshot 2020-05-16 at 15 23 04

Microsoft Data Science for VS Code Engineering Team: @rchiodo, @IanMatthewHuff, @DavidKutu, @DonJayamanne, @greazer

@opoloko opoloko added data science bug Issue identified by VS Code Team member as probable bug labels May 16, 2020
@DavidKutu
Copy link

Thanks for your feedback @opoloko. You should be able to see the developer tools on Help -> Toggle Developer Tools. Please share the errors that come up there, they will help us see the issue.

@ghost ghost added the triage-needed Needs assignment to the proper sub-team label May 21, 2020
@greazer
Copy link
Member

greazer commented May 21, 2020

@opoloko, sorry for your trouble. (Not a data-science specific problem)

@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label May 26, 2020
@karrtikr
Copy link

karrtikr commented May 28, 2020

Hey @opoloko
Unfortunately I am unable to repro this on Windows.

  • What is the full path to Python 3.6.8 64-bit?
  • Does using some other interpreter (non-conda) solve the issue? Please try creating a new virtual environment as well.
  • Does reverting to older version of extension solve the issue?

Also, please paste the output panel and developers tools logs mentioned in the issue template.

@karrtikr karrtikr added the info-needed Issue requires more information from poster label May 28, 2020
@karrtikr
Copy link

karrtikr commented May 28, 2020

We used child_process.exec to run the command

. /usr/bin/activate && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python /var/lib/code-server2/extensions/ms-python.python-2020.5.78807/pythonFiles/pyvsc-run-isolated.py /var/lib/code-server2/extensions/ms-python.python-2020.5.78807/pythonFiles/printEnvVariables.py

This seems to be an issue with node itself. nodejs/node#2333 (not sure why this was closed)
Looks like TTY is not set in child processes which is leading to this error. There's a workaround to set these with child_process.spawn https://stackoverflow.com/questions/31866207/spawning-a-child-process-with-tty-in-node-js but unfortunately not with .exec.

Please try executing the command with child_process.exec outside of the extension, and if that doesn't work, it's an issue with node so please report it there.

@karrtikr
Copy link

Closing as no further info was provided.

@ghost ghost removed the triage label Jun 17, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Jun 24, 2020
@int19h
Copy link

int19h commented Jul 25, 2020

The error message "stdin: is not a tty" does not originate from conda. It originates from bash, or rather more specifically, from a common (and, arguably, broken) bash setup that tries to run mesg without checking whether the shell is running in a tty context or not first. Here is a lengthy explanation - note that there's no Python in the picture at all.

But anyway, the message is actually a warning. The problem is that it's printed to stderr, and it looks like the code that's invoking exec() here treats any stderr output as a fatal error. If it simply ignored that message, I think activation would have worked just fine.

@karrtikr
Copy link

karrtikr commented Jul 26, 2020

@int19h I see 👍
The way I see it, if it's that common, it's another reason to go with the hidden terminal approach as it won't have this problem.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

6 participants