-
Notifications
You must be signed in to change notification settings - Fork 274
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
Error when launching Interactive Window for the first time #643
Comments
@craph Thanks for logging this, and apologies about the issue. You've given me some good info to start looking into this. But if you could, could you please set the following setting Python->Logging->Level to "debug" and then restart and repro the issue. Then could you copy out what you see in the "Python" dropdown section of the output window? That might have more info leading up to this issue that could help me investigate. |
Also where was this version of python installed from? Was it the Windows store installed python? |
Hello @IanMatthewHuff ,
Here is the extension of my python extension for VSCode : ms-python.python Here is the output :
|
@craph Thanks for the log. That's making things more clear here. This here looks like the interesting bit:
Our tool requires that ipykernel be installed into the environment that you are working with, and here it's failing to find it. In this scenario you should (I'm thinking there might be an issue here with it not showing) see a prompt to install ipykernel and then the launch should work. Are you seeing an install message here? And do you happen to know if ipykernel is installed into that env? Looks like it's specifically the python installed here: |
@IanMatthewHuff Thank you very much for the update. As you can see in the first message here is the prompt to launch the install of ipykernel : But when I click on Yes to install it -> it fails... You have all the steps in my comments. The only way to install it is to type the command manually and add double \ it's not normal... |
@craph Didn't want you to think that I had dropped this as I'm still looking into it. I'm not sure that the slash issue that you were seeing is actually the root problem here. I'm normally on Mac, but I jumped over to my windows machine and the command that I see in the Output->Python log to install ipykernel is the same as the one that you have. Currently I'm not able to repro the path issue that you are seeing, and I've not had this issue reported from other customers so it's a bit hard to fix without a repro that I can look at locally. However based on the log I did build a new vsix that has some smaller tweaks to how we run the ipykernel install command. I'll try to attach it to a comment here. |
@craph Github won't let me attach the file (too large) but if you contact me at ianhu@microsoft.com I could provide you with the new vsix to test and instructions to try it out. |
Try this one, though it's from a previously working installation. Was able to run things fine using the remote ssh tools 3 days ago, but I've been working from home, so I hadn't tried doing anything locally all summer. Mine asks me to install an IPyKernel 3 times in a row. User belongs to experiment group 'AlwaysDisplayTestExplorer - experiment'
Error 2020-08-24 12:52:50: Exception attempting to enumerate kernelspecs: r [Error]: Traceback (most recent call last):
Error 2020-08-24 12:52:50: Kernel spec not found: r [Error]: Traceback (most recent call last):
vslsStack: [ CallSite {}, CallSite {}, CallSite {}, CallSite {}, CallSite {} ]
|
@kalingibbons I would actually recommend opening a new issue for this. The original issue here is specifically for the issue where we mess up our paths on windows. I don't see that issue in your log at all and if we resolve the original issue here I don't want to lose fixing your issue in the mix as well. I did take a look through the log though. Seems that there is an error earlier on when trying to start up this automesh environment.
I think that's actually the root cause in your case and the ipykernel install prompt is just fallout from that. From a quick look online it seems like this issue might be from missing anaconda paths on the main path. https://stackoverflow.com/questions/52821162/jupyter-notebook-failed-to-load-dll If conda is failing to activate correctly then you might try running VS Code from a command prompt with the automesh env activated. That can sometimes help with these conda issues. |
Thanks, I've done that after figuring out I could get it working by calling |
@IanMatthewHuff I'm always unable to install ipykernel in my VScode. It's really strange Here is the output :
|
I'm using Python 3.8.5 64bit and same issue with Python 3.8.5 32bit |
@craph Are you using any type of virtual env for your environment? That can sometimes help with resolving module install issues as you can start out with a full fresh environment. I'd recommend trying steps like this:
|
Hi @IanMatthewHuff , I have created a new venv like you suggest me but it's the same issue.
After activating the venv I have :
But when I open the Interactive window I always have the prompt to install ipykernel again and again... If I click yes I always have the error.
Here is my version output of VSCode:
|
I also can't connect to any kernels through vscode. jupyter lab is fine but with vscode i am usually prompted to install ipykernel (which is already installed). Hitting "yes" just results in an error. this is the case whether I open vscode and select the interpreter or use a conda WT and open with It looks like its always trying to load the Microsoft Store python even though I'm using conda
if I open a jpuyter notebook first it usually works
and then aftewards a normal interactive window works too
|
@dschneiderch Thanks for reporting, but could you please file a new issue for this? It's not the same root issue as the original post in this thread. If you could do that an include the full console log (if you copy it out and save it as a file you can attach that file to a comment on the issue) |
@IanMatthewHuff Don't know if you saw my issue before I closed it, but mine was due to settings sync. Feel like that'll be common as people try turning it on. |
@IanMatthewHuff I created an new issue but i'm not sure how to get a full console log. I copied the stuff under the "Output" tab for Python and Python Language Server |
@craph I created a new version of the python extension with a possible fix and some more logging added. If you want to try this out you can download it from here: If you uninstall the Python extension from the extensions page you can use the "Install from vsix" command to install the one that I provided and uninstall it just using the extension uninstall button, so it should be very easy to try it out and remove it after. |
@kalingibbons It might be possible to be related, but the core issue for @craph is the path resolution here:
I could be off, but I don't recall seeing the same symptom in your logs. |
@IanMatthewHuff , After that, I open the Python extension start page and click on "User the Interactive Window to develop Python Scripts" and here I haven't the prompt to install ipykernel but all is fine. The Python Interactive is OK. 👍 What did you fix in this version ? Is it possible to check the diff, commit here and be available in the official store ? Here is the output of Python :
|
@craph Yes, we can get this fix checked into the main extension. You've been very helpful as well with testing this as I've not been able to repro this locally. Can I ask you for one more favor? The VSIX file that I previously gave you had two different fixes in it, since I wasn't fully sure which would fix the issue. I've generated a new VSIX here with just one of the fixes. Could you please try this out and see if it works for you? It would be good to either generate a new python environment or uninstall ipykernel from the existing environment so that it tries to do the install again. https://1drv.ms/u/s!AtMGc9apDXrG20aoPf9svOXVZnMD?e=S3io4G
If you are interested we have code that specifically converts arguments for use on a command line. It does some work with quoting and backslashes to make sure that the command runs property. on either windows or mac or linux. Seems like one particular command path wasn't getting this argument conversion. |
Yes I'll test it with pleasure. I have just download the file. It has the same size like the previous one is it normal ? Please could you tell me how can I remove the module ipykernel correctly to be sure I can test the new version correctly ? May be like that ?? : $ pip uninstall ipykernel
Found existing installation: ipykernel 5.3.4
Uninstalling ipykernel-5.3.4:
Would remove:
c:\users\myuser\appdata\local\programs\python\python38\lib\site-packages\ipykernel-5.3.4.dist-info\*
c:\users\myuser\appdata\local\programs\python\python38\lib\site-packages\ipykernel\*
c:\users\myuser\appdata\local\programs\python\python38\lib\site-packages\ipykernel_launcher.py
c:\users\myuser\appdata\local\programs\python\python38\share\jupyter\kernels\python3\kernel.json
c:\users\myuser\appdata\local\programs\python\python38\share\jupyter\kernels\python3\logo-32x32.png
c:\users\myuser\appdata\local\programs\python\python38\share\jupyter\kernels\python3\logo-64x64.png
Proceed (y/n)? y
Successfully uninstalled ipykernel-5.3.4 Now after installing your new version, I have this error :
I think something is missing. |
Hi @IanMatthewHuff , |
Hi @craph, @IanMatthewHuff is actually on vacation this week. You could try this version here: This should ship in our next month's release. |
Hi @rchiodo I have juste dowload and it's not working. The first version from @IanMatthewHuff solved the issue I think but now it's worse And in the output I have :
|
You're getting this error now (not related to Ian's change):
Did you use a different python environment? I'd try installing ipykernel again. |
@rchiodo Hi, |
The error states that ipykernel_launcher is not installed. Can you verify that it is? It might be something else that's wrong. |
@rchiodo please could you give me the correct way to check this point ? I have no result with that : |
You can do this to check (pip won't list it).
If it's not there, you can reinstall ipykernel. For me this is what I get:
|
@rchiodo Python 3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:57:54) [MSC v.1924 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import ipykernel
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'ipykernel' But if I remember good, this module should normally installed automatically with the Python extension when I click on the button for Interractive window but it's not the case. Then I click "Yes" and I have:
|
@craph Looks like your extension version doesn't have the fix from the private VSIX that I made. I'm not fully sure on this but I believe that when we release a new version of the extension it will replace existing private builds if you have your extensions set to auto update (which is the default). Could you try installing the previous vsix that worked for you and checking the number on it? I think the issue might be that we released a new public version (which doesn't have the fix for that) and it replaced the working private vsix with a new public version. |
Hi @IanMatthewHuff Thank you for the update. Here is the link of the vsix that was working for me : https://1drv.ms/u/s!AtMGc9apDXrG20TSPBLSo2zQ7Xkj?e=1GEFue But now it doesn't work anymore and I have the following error:
The version is : v2020.9.0-dev And I have this error : No module named ipykernel_launcher for the version: v2020.9.243884588-dev No more version are working for me now 😭 I have uninstalled all the version and restart vscode none are working Here is the output log for python:
And here is the error with the current official production version :
Version : v2020.8.109390 |
@craph sorry about the delay here. I hadn't commented back here as we believed that we were rolling out the fix for you in the most recent version of the extension, which we just released a day or two ago. Have you tried the newest version of the extension? However we just found that this fix might actually be causing issues for other customers. I looked back through the logs now and I do actually see what the root cause for you probably is. Sorry for missing it before. Looks like you are using git bash as your default terminal. This terminal (git bash on windows) is actually not supported by the python extension. You'll run into other issues using it. I'd recommend using command prompt or powershell instead when on windows. |
Hi @IanMatthewHuff, You're right, I have installed git-scm on my Windows laptop for my job and I've installed it with git-bash. When I launch Vs-code I haven't did any specific settings about terminal. How can I deal with this ? Your advise is to remove git-scm ? Or can I change it in vs-code only ? When I install the Python extension, i havent specify to use git-bash ... it's really weird I don't know what to do. I use git-bash as a command line interface to run admin git commands on various projets... |
@craph so the docs for the integrated terminal are here. For the python extension we use this default integrated terminal, so you would just have to change a setting in vs code to change this, you don't need to change anything else about your system. On windows there is a convenient way to change the terminal setting here: Changing it from git bash to either powershell or normal command prompt should unblock you. |
@IanMatthewHuff I confirm that by selecting PowerShell 7 as the default Shell the interactive Window is now working. I have been able to install ipykernel successfully. Sorry for the inconvinience about this issue and my git-bash. Is it planned to support Git-bash ? Many thanks for your help. |
To answer this question:
I believe the answer is maybe? Looks like this issue here covers it: |
Bug: Notebook Editor, Interactive Window, Editor cells
Steps to cause the bug to occur
Install the Python Extension
Click on the "Use the Interactive Window to develop Python Scripts"
On the right side bar click to install ipykernel
Actual behavior
When I click to install ipykernel I have the following error :
Expected behavior
ipykernel must be installed without any errors. As you can see, there are an error with the forwarded slash in the path url...
Your Jupyter and/or Python environment
Please provide as much info as you readily know
Python Output
Microsoft Data Science for VS Code Engineering Team: @rchiodo, @IanMatthewHuff, @DavidKutu, @DonJayamanne, @greazer, @joyceerhl
The text was updated successfully, but these errors were encountered: