-
Notifications
You must be signed in to change notification settings - Fork 293
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
Failing to detect ipykernel module #2446
Comments
Hi @y2kbugger Thank you for reporting the bug. I just tried it and couldn't reproduce it. |
Thanks for reporting this issue. If you do not wish to to so, you could select another interpreter or another kernel. Closing this issue as this is by design. Note: The error you are getting about Please could you select |
See photo, ipykernel is installed
When you click update it spins. I could ask the user to try that again.
Our conda environment is bepoke in these ways:
Because of these customizations I thought we might've found an edgecase of the new kernel loading mechanism. The thing that really bothered me is that after some time had passed, with no updates to VSCode( I checked), or the python extension, began to work for the user I was working with. It also doesn't happen on all on my machine. There were definitely tracebacks in the developer console...but I failed to copy them..... |
Please could you send the logs when this happens. Open Please could you also try the following:
|
vscode_ipykernel_reproduced_error.log
In cygwin, with proper conda activation
In cmd, without conda activation
|
Thanks for the feedback
|
Logs I thought I attached as file, let me know if that is not the case. I
will get the rest of the other info tomorrow.
Without my work computer I can say this much regarding the vscode terminal.
We have customized vscode terminal to use bash, and we activate the base
conda env via .bashrc. I have definitely seen vscode try to (re)activate
the base env upon opening, but I don't think that is the case across all
developers(specifically I've seen it on other dev's computers but I don't
think I've seen it on mine ever) I'll get you the specific command we've
set the terminal to and I'll try to reproduce issue after resetting that to
default.
…On Tue, Jan 14, 2020, 19:30 Don Jayamanne ***@***.***> wrote:
Please could you:
- Send a screenshot of the bottom left of the VS Code status bar (this
is where we display the selected python interpreter information).
- Open a python file in VS Code, then open a terminal.
- Let me know what commands are sent to the terminal. Do you see
any conda activation commands being sent to the terminal
- Please could you try repeating the same steps to repro the issue and
send the logs as requested earlier (you missed that). I'm after the
contents of the console window when you get the error message ipykernel
not installed
- Please could you type the following in your terminal and let me know
what you get:
- conda --version
- conda env list
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<https://github.com/microsoft/vscode-python/issues/9566?email_source=notifications&email_token=ABORVLMM3V45UWEJLI5QOY3Q5ZKJDA5CNFSM4KGIQ75KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEI6T7SQ#issuecomment-574439370>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABORVLOYYXDKRX4C4HIVQMTQ5ZKJDANCNFSM4KGIQ75A>
.
|
I'm having the same issue. The Interactive windows will take forever to load. But if hit X on the notification message, the interactive window will run normally. |
@xquyvu please could you provide the logs |
Log attached
conda --version
conda env list
|
There are no extra commands sent to my terminal, I have seen them before on other developer's computers. I have been able to reproduce the issue on my computer. Here are the settings for my terminal
Attached in this comment https://github.com/microsoft/vscode-python/issues/9566#issuecomment-574316842
|
Please could you try the following in your terminal:
Let me know what you get
Thanks |
@y2kbugger Thanks
Please could you run |
I am sceptical of running I do however see the activation happening in the cmd. Cygwin was already configured to activate properly before getting to the user prompt and we have never had an issue running cygwin outside or inside of vscode. Even TUI such as vim work fine in cygwin via the vscode terminal. Unless there is a reason to move away from it, the effort to goto WSL can't be justified. |
The python extension doesn't support cygwin terminals in Windows environment. On a side note, we have identified a problem with detection of modules. Once that's in i'll upload a copy of the extension that you could download and test at your end. Lets try to test with the new version (will upload and let you know). |
@y2kbugger can you try Don's fix here? Thanks |
I can confirm that this fixes the issue. |
Thanks. |
see my SO for details: https://stackoverflow.com/questions/59867847/how-does-one-connect-a-jupyter-kernel-to-vs-code-if-one-does-not-connect-automat Copy pasted from my SO question : I want to be able to have a working jupyter notebook working for VS code out of the box, with minimal work on my side. I tried opening a jupyter notebook. I immediately found the interpreter and used my conda env with the command pellet (
also running python scripts from VS Code seems to be working fine too, see output:
but when I try the jupyter notebook it doesn't work. Most noticeably my VS code does not have a kernel connected, look at the screenshot: I tried clicking on a couple of arrows as suggested on reddit (vs_code_jupyter_server_no_kernel_python_not): When I try running things in my jupyter notebook I get the following error:
which is strange. My shell is not even bash so I don't know why that message is being shown to me (maybe VS Code doesn't know Mac OS Catalina uses zsh? not sure how to fix that for VS Code). Regardless, I proceeded to do what I think the error message is suggesting. So I did the following: I ran conda init and then went down to the terminal inside vs code and restarted the shell by running zsh but the jupyter kernel still doesn't work on my notebook in vs code. Not sure what's wrong. In addition, I did what the error message suggested:
but it seems it made no difference. Any idea how to fix this? Related resources:
|
I was told the issue stems from (I assume it will be built since thats the default shell for mac now, starting in macOS Catalina) |
@y2kbugger sorry for bugging you, but do you mind sharing precisely what commands/things you did? Thanks in advance. |
@brando90 the insider's build of the extension should have Don's fix for this problem. You should be able to install that VSIX in the extensions panel. If that doesn't work, we're working on a further fix here: |
Sorry for spamming you, just to make sure I did the right thing. I downloaded the Then I got the following output (from the vs code terminal):
after that I went back to the jupyter notebook but still failed to work with the usual error msg I get:
is that what you wanted me to do? If that is what you wanted me to do I guess I just need to wait. Thanks in advance for all the help and quick responses. |
That makes it look like you need to go outside of VS code, run a terminal, then run 'conda init bash' |
I did and I get this output:
then I opened VS code and tried running my jupyter notebook but it still fails. Though, the VS code terminal was using bash by itself this time, although jupyter still fails but with a new message, referncing the file you gave me and I installed with the vsix extension:
|
btw I am fine using bash until zsh is supported...though that seems to be what I've been trying to do with my last exchange although it still failed...have you guys tried it with bash in Mac OSX? |
although I start a new bash instance by typing bash in my terminal application:
it seems it still pointing to zsh...this OS change to Catalina has brought me so many issues... :( |
Again, you can use zsh. However if you recently updated to catalina and are having issues outside VS Code in zsh/bash. I suggest you first resolve that. |
I have that right. But I assume the Look at my file:
|
No issue right now, thank god. |
When I do that I get this:
but jupyter is still not working and it's still not detecting a jupyter kernel. |
Until this works:
Jupyter won't start. If you look in our console log (Help | Toggle Developer Tools, click on the Console tab) you can see what exact command we're running for conda activate. That doesn't seem to be working on your machine. Conda thinks you need to run conda init, but there must be something else that isn't working. I think this might be a clue:
Line 31 of your bashrc is referencing a file it can't find. |
Ok, I've removed all lines of code from my I guess the puzzling thing is that it's even running my Anyway, I removed those lines and now when I start
seems that it's running my That's the state of things right now. Odd. |
This still looks like your bashrc is invalid:
That means conda is not initialized (as it should find it). Which would prevent us from starting Jupyter (as we have to run conda activate). Not sure why 'conda init' didn't work, but until 'conda' by itself from 'zsh' or 'bash' works, Jupyter won't likely start. |
@DonJayamanne seems that after I removed the conda command from my Somehow removing all errors makes the jupyter notebook work, but I don't think this is the intended way to have this work for the user, right? Why did I have to go through this if conda was working for my From a user's perspective I expected it to work out of the box but it didn't...is what Im trying to say. |
No, this isn't a VS Code issue. Basically conda wasn't working for you in bash and thats outside of VS Code (i.e. we dont control that behavior).
Agree, however user environments are beyond the control of the extension. Hence the request to ensure the shells are configured correctly.
I guess this is because you hadn't updated VS Code to use zsh shell. VS Code has the ability to use a shell as the preferred shell in VS Code. |
I totally agree, you can't control the user's environments. However, I am not using bash at all, so I don't understand why my Thanks so much for the help! :) |
I was having similar symptoms and had a hell of a time solving the problem. I finally realized that I had accidentally created two environments with the same name. I deleted the environment and the folder with the same name, and now everything works as it should. I have no idea if my issues are at all a clue to these other issues, but I thought I would at least share them here. You can remove my comment if it is unhelpful. |
I'm still experiencing this issue. |
Sorry but that's a little ambiguous. What exact issue are you having? IPyKernel not being detected? This can be caused by any number of things, some of which are outlined above. Your best bet is to
|
Thanks and sorry for the ambiguity. Yes, my issue was IPyKernel not being detected but launching vscode from an activated virtual environment seems to be doing the trick. Is that the recommended workflow to avoid IPyKernel detection issues? |
That's the recommended workflow if anything goes wrong with Conda. If you search 'conda' in the python extension issues there's lots that can go wrong with conda activation. It works out better if you activate outside of VS code and just use that. |
Steps to cause the bug to occur
Actual behavior
Loads forever.
Notifys that ipykernel is not installed
Expected behavior
Your Jupyter and/or Python environment
Please provide as much info as you readily know
Developer Tools Console Output
Also it appears to be intermittent....at lease on one occasion today the user reported and showed me that it did "Work" and the ipython kernel was started. I couldn't tell whether it was daemon or fallback.
Let me know if you need any more details.
Microsoft Data Science for VS Code Engineering Team: @rchiodo, @IanMatthewHuff, @DavidKutu, @DonJayamanne, @greazer
The text was updated successfully, but these errors were encountered: