Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Plotly introduces errors with magic syntax highlighting in Jupyter #427

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

Closed
msftristew opened this issue Mar 21, 2016 · 10 comments
Closed

Plotly introduces errors with magic syntax highlighting in Jupyter #427

msftristew opened this issue Mar 21, 2016 · 10 comments

Comments

@msftristew
Copy link

It looks like the init_notebook_mode() function introduces some conflicts with Jupyter that causes magics syntax highlighting in IPython to not work correctly. The issue is that Plotly seems to conflict with the mechanism that Jupyter uses for magics syntax highlighting.

Repro steps:

  1. Make a simple IPython wrapper kernel and configure it to use syntax highlighting for a non-Python language in a cell with a particular cell magic, e.g. SQL syntax highlighting after the %%sql magic
  2. Run init_notebook_mode in a cell
  3. Try to run a cell with the %%sql magic; syntax highlighting will not work and errors will be logged to the JS console

Here are some screenshots for my machine. Syntax highlighting gets turned off after I run init_notebook_mode:

image

When I type %%sql in the cell, these errors get logged:

image

... so it looks like the call to init_notebook_mode is interfering with Jupyter's require.js machinery in some way.

I am wondering if this issue is related to issue 90 or if it happens to have been solved in this commit.

@msftristew
Copy link
Author

CC @aggFTW, @MohamedElKamhawy

@msftristew
Copy link
Author

Running plotly 1.9.6, BTW

@aggFTW
Copy link

aggFTW commented Mar 21, 2016

cc. @etpinard @jdfreder

Thanks!

@jdfreder
Copy link
Contributor

Hi @msftristew the commit you referenced should fix it, and that commit has been merged into plotly master

@msftristew
Copy link
Author

Thanks @jdfreder. When will the next version of plotly be released that will have this fix?

@watersavvy
Copy link

Hello, I am new to Jupyter as of this week and ran into the same error message. What does "ERROR: Cell magic 'sql' not found." indicate? This syntax based on previous inputs should work:

%%sql
SELECT start_time AS "exam start time"
FROM exam_answers;

Any ideas?

@msftristew
Copy link
Author

In my screenshot, the %%sql magic doesn't actually exist, I'm just using it as an example to show how this function breaks syntax highlighting.

@msftristew
Copy link
Author

Ping :)

Is there an ETA on the new version which will fix this?

@cldougl
Copy link
Member

cldougl commented Apr 4, 2016

updated with: #432

Should work now!

@msftristew
Copy link
Author

It does! Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants