-
Notifications
You must be signed in to change notification settings - Fork 294
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
Python Interactive Windows errors with vscode-remote #3399
Comments
It tries to run the script in bash. Not sure if this is an issue with the devcontainer or the Python extension. Hoping for insights from the Python extension team. |
This wouldn't be us. This is jupyter running that command. We send it code to execute and it's not using python for some reason. |
Can you attach your developer console output? (Help | Toggle Developer Tools, click on console, right click, save as) |
See attached with some errors: I also tried restarting the "rebuild container" option and that also produced a few errors. remote-interactive-windows-restart.log And one more when I (think I) just switched to the the devcontainer.json file. |
Yeah that looks like the extension isn't finding the python in use. Or at least one of them. It does start jupyter though. What happens if you open a terminal and type 'python -m jupyter notebook --version' |
Actually it looks like it's using 'python3', so type 'python3 -m jupyter notebook --version' |
Will check tonight. Weird that it can start jupyter without finding python though right? |
I think I found the issue. This container has multiple kernels, including R and Bash. When I deactivated the Bash kernel the python code does run but I still get the error shown below. So there seems to be an issue with the extension using the correct kernel (based on the open file type). This seems directly related to the following issue: https://github.com/microsoft/vscode-python/issues/3763 It would be great if you could specify which kernel(s) you would want to use in FYI Requested output shown below:
|
(The |
What's the value of |
I just noticed that there is a
|
We use the default kernel unless the user has ipykernel installed and we can change it. Can you check what 'python3 -m ipykernel --version' returns from the terminal window? |
From a terminal inside the container I get.
|
Hmm. I wonder why it's not writing it then. What does this list:
We use that to enumerate the installed ones and try to match the best one if ipykernel fails. |
I get the following:
|
We must not be matching for some reason. I was thinking the python one might not show up or not say python in the name, but it does, so it should match. In order to repro this you installed the bash and ir kernels into jupyter, right? |
I created a Docker file with Jupyter and R and Bash kernels and the image is available on Docker hub as https://github.com/radiant-rstats/docker/tree/master/install
|
Great. Thanks for looking into this @rchiodo. Please do let me know if I can test anything. A fix for automatic selection would be great but even better would be to have an option to set which kernel to start (or running kernel to connect to) like hydrogen has would be a fantastic feature to have (https://github.com/microsoft/vscode-python/issues/3763#issuecomment-470265627) 💯 :) |
We have the selection for python on the bottom, it's supposed to use that one as your 'kernel' for the Python Interactive window. Would you want something else (besides picking the python to use)? Other language kernels? |
Ah. I see. The python selection would be fine as is ... if it works :) but I would indeed really like to use R (and perhaps some other kernels) if possible in an interactive window where plots can be shown. |
Using other languages is a long term goal, but unfortunately it's going to take a while :( |
Would be interested to hear what the challenges are to (1) connect to running kernels and (2) connect to non-python kernels. Any idea if the kernel issue that started this issue is addressable? |
This bug should be addressable though. It's likely just picking the first kernel instead of the python one for some reason. |
I see. Thanks for the clarification @rchiodo. It seems that the approach in hydrogen is all JS based (https://github.com/nteract/hydrogen/tree/master/lib) so presumably easier to extend to other kernels. Any chance you could point me to where the relevant python code is in the repo? For some reason searches like "jupyter" don't give any code results. Just curious. |
The variable explorer bits are probably the biggest amount of work. Not even sure they're possible in other languages. Other stuff is just doing things like setting the current directory and modifying matplotlib (not sure if there's an equivalent in say R) We use the python files here to query variables from jupyter: |
Thanks @rchiodo! A variable inspector for R (and other languages) would be nice but not critical. Just running (and plotting) would already be a huge plus. |
FYI I upgraded jupyter and other packages in the https://github.com/radiant-rstats/docker/blob/master/rsm-msba/requirements.txt Everything works fine when I launch without vscode and in vscode with the mounted container I see the following information so jupyter is definitely available and installed in the container. This happens with both the release and insider version of the ms-python extension.
|
Starting jupyter is giving this: workbench.main.js:238 [Extension Host] Python Extension: Error: /usr/local/lib/python3.6/dist-packages/requests/init.py:91: RequestsDependencyWarning: urllib3 (1.25.2) or chardet (3.0.4) doesn't match a supported version! Sounds like urllib3 or chardet are out of date. |
Note to self (or whoever gets this bug), here's the directions on debugging a remote extension: https://code.visualstudio.com/api/advanced-topics/remote-extensions |
It seems this latest issue update I posted was a urllib3 version issue. I downgraded to urllib3==1.24 in the container (vnijs/rsm-msba:1.5.1) and now we are back to the "bash kernel being used instead of python3 kernel" issue we started with. Sorry for the confusion. I wrongly assumed this updated issue was related to changes in |
It is working @rchiodo. Thanks! |
Environment data
Expected behaviour
Python code running in the Python Interactive Window
Actual behaviour
Steps to reproduce:
cc-ing @chrmarti in case he has any comments/suggestions
The text was updated successfully, but these errors were encountered: