-
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
Some magic commands not working in Python Interactive window #3187
Comments
Not sure why they don't work. Jupyter is giving us nothing back as results for %pinfo or %magic. These may be client side only commands and we'd have to implement them ourselves. %pinfo should be easy to workaround though as we have a list of variables at the top of the window. |
I'm using this extension and can confirm that iPython's dynamic object information feature (https://ipython.org/ipython-doc/3/interactive/reference.html#dynamic-object-information) doesn't work. For example, But in plain iPython the function's docstring is shown: Here's my extension information: Name: Python |
Solution / workaround in https://github.com/microsoft/vscode-python/issues/7289#issuecomment-529973067 |
Just tested. Not a solution. |
@SJWackness Thanks for letting me know. #3119 probably should not have been marked as a duplicate of this issue... |
This might fix some of the problem. However it doesn't fix it for every command:
We need to investigate whether or not this should be part of our default set of code we run on startup. |
Same problem with %time and %%time. |
@aragong What results do you get for %time and %%time? They seem to work for me: |
If I use %%time and execute the code using ctrl+enter. UsageError: Line magic function If I use %%time ans execute the code selecting the lines and pressing shift+enter. Wall time: 1.86 s |
Can you share your code? This sounds like a different issue. At least CTRL+ENTER and SHIFT+ENTER are supposed to do the exact same thing, but one advances and the other doesn't. For me they both work, but maybe it has something to do with how you're executing. I'm using code like so:
|
Please try %%time If you have an empty line does not work for me but your previous code runs perfectly! I'm using a .py file working on Interactive python from miniconda with cells (#%%) I do not know if that helps! |
Wow, weird. Sorry but that works for me just fine. Perhaps there's extra chars on that line? And CTRL+ENTER doesn't work, but SHIFT+ENTER does? What do you have mapped to CTRL+ENTER? Maybe there is some extra command running too? |
How can I restore default keyboard shortcuts? Maybe the problem is that?? |
Use the open keyboard shortcuts (JSON) command. It should open the JSON file that has your remappings. If you delete everything in there it will reset you back to default. |
Not sure. Although I think we should move to a new issue (as your problem doesn't seem related to the one this issue is about). I'll create one: |
@rchiodo This comment really belongs to #3119 which unfortunately has been erroneously marked as duplicate of this issue and locked for comments. The workaround for the problem that I had found for this issue now no longer works: There is now absolutely no way left to work with IPython commands from vscode. Would it be possible to reverse whatever "broke" the workaround until this issue will be solved more permanently? |
Sure but we'd have to know what caused it. I would hazard a guess that jupyter 'fixed' something and now we're not getting the output we expect. |
Looking through the IPython code, it looks like there's another message that Jupyter is sending us for some of these things. We need to listen for IExecuteReplyMsg responses. One of these will have the pager results: Not sure how we interpret the page of data, but this would at least get the Jupyter opens page results in a separate tab at the bottom. |
Moving back to triage. This seems like a hole in our implementation that we should fill in sooner rather than later. |
In that way to conclude that is nothing to do with my environment (in conda and in the vscode), I will try: |
Validated (mostly). I checked the ones listed in this thread and a sampling of other magics. These all worked: I did hit one that worked on jupyter and not here: But I think we can look for a customer upvote or request for that. |
%lsmagic doesn't work for me, using 1.51.4 OSS version on Manjaro Gnome 20 |
Environment data
VS Code version: 1.36.1
Extension version (available under the Extensions sidebar): 2019.8.29288
OS and version: MAC 10.14.4
Python version: 3.7.1
Expected behavior
Inside the Python interactive window, I want to use magic commands like %magic or the question mark like foo?
Actual behavior
Some magic commands are working (like %history or %pylab), but other do not work, like %magic or %pinfo which is equivalent to the question mark foo?
I understand this might be related to this closed issues: microsoft/vscode-python#4170 microsoft/vscode-python#5565
However the behaviour of some magic functions are not the same inside the Python interactive window compared to an ipython terminal.
I do not know if this issue is from my side, or if it is by design in the Python interactive window, or if it will be solved in a future release.
The text was updated successfully, but these errors were encountered: