Skip to content
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

Magic commands not parsed anymore in interactive .py files. #7557

Closed
rsebbe opened this issue Sep 16, 2021 · 2 comments
Closed

Magic commands not parsed anymore in interactive .py files. #7557

rsebbe opened this issue Sep 16, 2021 · 2 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug interactive-window Impacts interactive window

Comments

@rsebbe
Copy link

rsebbe commented Sep 16, 2021

Environment data

  • VS Code version: 1.60.1
  • Jupyter Extension version (available under the Extensions sidebar): v2021.8.2041215044
  • Python Extension version (available under the Extensions sidebar): v2021.9.1230869389
  • OS (Windows | Mac | Linux distro) and version: Mac
  • Python and/or Anaconda version: 3.6.10
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda
  • Jupyter server running: Local

Expected behaviour

When executing cells from interactive .py python files (as opposed to .ipynb notebooks), magic commands are not parsed anymore. This used to be the case earlier this year, and pretty useful.

These lines are ignored (no effect)

#!%load_ext autoreload
#!%matplotlib osx
#!%config InlineBackend.figure_format='retina'
#!%autoreload 2

I need to use this instead (which is less practical, and makes it harder to move code between .ipynb / .py files)

from IPython import get_ipython
from numpy.core.fromnumeric import size
get_ipython().run_line_magic('load_ext', 'autoreload')
get_ipython().run_line_magic('matplotlib', 'osx')
get_ipython().run_line_magic('autoreload', '2')

my settings.json does include this:

"jupyter.magicCommandsAsComments": true,

Actual behaviour

Nothing is executed

Steps to reproduce:

No particular steps, code is just ignored. It used to work previously (2020, early 2021).

Logs

@rsebbe rsebbe added the bug Issue identified by VS Code Team member as probable bug label Sep 16, 2021
@joyceerhl
Copy link
Contributor

Apologies for the trouble. This is a duplicate of #7481. This should already be fixed in Insiders and will be released to Stable at the start of October.

@joyceerhl joyceerhl added interactive-window Impacts interactive window and removed needs-triage labels Sep 16, 2021
@rsebbe
Copy link
Author

rsebbe commented Sep 17, 2021

Apologies for the trouble. This is a duplicate of #7481. This should already be fixed in Insiders and will be released to Stable at the start of October.

Thank you for the quick follow-up, much appreciated.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 25, 2021
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 interactive-window Impacts interactive window
Projects
None yet
Development

No branches or pull requests

3 participants