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

Turtle widgets support is just not workin ... and always giving error of "error loading nbextensions/mobilecheloninjs/turtlewidget" #8241

Closed
thearpankumar opened this issue Nov 11, 2021 · 9 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug ipywidgets Rendering, loading, saving, anything to do with IPyWidgets verified Verification succeeded
Milestone

Comments

@thearpankumar
Copy link

Environment data

  • VS Code version: 1.62
  • Jupyter Extension version (available under the Extensions sidebar): 2021.10.1001414422
  • Python Extension version (available under the Extensions sidebar): 2021.11.1
  • OS (Windows | Mac | Linux distro) and version: windows 10 build 19042
  • Python and/or Anaconda version: 3.9.3
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): n.a
  • Jupyter server running: Local | Remote | = local

Expected behaviour

it should show the turtle widget and start plotting and show the diagram....

Actual behaviour

it just do not show the widget of turtle and gice eroor of attribule eroor in "t.pensize" which is valid and shows widget to download support file but in the final it does nothing . and give more errors

Steps to reproduce:

[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]

  1. just use this valid code .
  2. from mobilechelonian import Turtle
    from ipywidgets import interact
    import turtle
    t = Turtle()
    t.pencolor("red")
    turtle.begin_fill()
    t.pensize(3)
    t.left(50)
    t.forward(113)
    t.circle(50,200)
    t.right(140)
    t.circle(50,200)
    t.forward(133)
    turtle.end_fill()
    input()

Logs

Output for Jupyter in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Jupyter)

"Eroor given by jupyter :- "

AttributeError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_1972/308323382.py in
5 t.pencolor("red")
6 turtle.begin_fill()
----> 7 t.pensize(3)
8 t.left(50)
9 t.forward(113)

AttributeError: 'Turtle' object has no attribute 'pensize'

Arpan kumar 

email : - arpankumar11119@gmail.com note :- add support for turtle also in jupyter vs code ....
@thearpankumar thearpankumar added the bug Issue identified by VS Code Team member as probable bug label Nov 11, 2021
@thearpankumar
Copy link
Author

you can check the code also if it is wrong tell me ... and ... also tell be briefly why turtle is working out of the box in this case like annaconda jupyter ........

@DonJayamanne DonJayamanne added the ipywidgets Rendering, loading, saving, anything to do with IPyWidgets label Nov 11, 2021
@DonJayamanne
Copy link
Contributor

I've had a look at the code, and looks like the widget is written in such a way that it will only work on Jupyter.
The root cause is one of the JS files is looking for code in nbextensions folder as follows:

define(['nbextensions/mobilechelonianjs/paper', "@jupyter-widgets/base"], function(paperlib, widget){

We could probably try to pre-emptively register all of these.

@arpan02122004 , Unfortunately for now I cannot find a workaround for this issue, I'll take a look at this.

@greazer greazer changed the title Turtle widegts support is just not workin ... and always giving error of "error loading nbextensions/mobilecheloninjs/turtlewidget" Turtle widgets support is just not workin ... and always giving error of "error loading nbextensions/mobilecheloninjs/turtlewidget" Nov 11, 2021
@thearpankumar
Copy link
Author

what is the root cause of this ..... anything can be done to fix this .....?

@DonJayamanne
Copy link
Contributor

DonJayamanne commented Dec 14, 2021

what is the root cause of this

The root cause has been clearly documented , in the previous comment.

anything can be done to fix this .....?

Unfortunately this issue hasn't been priotized yet, we prioritize issues based on community engagement (upvotes) and usage.

@DonJayamanne
Copy link
Contributor

@arpan02122004
I believe this has been fixed, and you should be able to verify the fix in the latest pre-release version of the Jupyter exetnsion in VSCode insiders.

FYI - I've tested this at my end and it works as expected.

@DonJayamanne DonJayamanne self-assigned this Jun 17, 2022
@DonJayamanne DonJayamanne added this to the June 2022 milestone Jun 17, 2022
@DonJayamanne
Copy link
Contributor

I'm closing this as fixed, as I can no longer repro this and the fix for #10319 should fix this as well.
@arpan02122004 If this doesn't work in the ltest jupyter pre-release version, please do let us know and we'll re-open this issue or optionally please feel free to create a new issue.

@rchiodo
Copy link
Contributor

rchiodo commented Jun 30, 2022

The example provided here does not work for me. No output is shown and the jupyter log shows this:

nfo 11:44:30.478: Widget Message: WidgetManager: Loading class LayoutModel:@jupyter-widgets/base:1.2.0
info 11:44:30.515: Widget Message: WidgetManager: Loading class DOMWidgetModel:@jupyter-widgets/base:1.2.0
info 11:44:30.685: Widget Message: WidgetManager: Loading class TurtleView:nbextensions/mobilechelonianjs/turtlewidget:
info 11:44:30.685: Widget Message: WidgetManager: failed, Loading class TurtleView:nbextensions/mobilechelonianjs/turtlewidget:
error 11:44:30.685: Widget load failure {} {
  className: 'TurtleView',
  moduleName: 'nbextensions/mobilechelonianjs/turtlewidget',
  moduleVersion: '',
  cdnsUsed: false,
  isOnline: true,
  timedout: false,
  error: '{}'
}

@rchiodo rchiodo reopened this Jun 30, 2022
@rchiodo rchiodo added the verification-found Issue verification failed label Jun 30, 2022
@github-actions github-actions bot added the triage-needed Issue needs to be triaged label Jun 30, 2022
@rchiodo
Copy link
Contributor

rchiodo commented Jun 30, 2022

This probably has some impact on the issue - I'm using raw kernels.

@DonJayamanne DonJayamanne removed the triage-needed Issue needs to be triaged label Jun 30, 2022
@DonJayamanne
Copy link
Contributor

Notes:

  • Install mobilecheloniajs
  • Have a look at widgets an see whether it uses _view_module when loading the script files.
    • We might want to support that.

Heres the source from the widgets

    pkgdir = os.path.dirname(__file__)
    nbextensions.install_nbextension(os.path.join(pkgdir, 'mobilechelonianjs'),
                                     user=True)

class Turtle(widgets.DOMWidget):
    _view_module = Unicode("nbextensions/mobilechelonianjs/turtlewidget").tag(sync=True)
    _view_name = Unicode('TurtleView').tag(sync=True)

@rchiodo rchiodo modified the milestones: June 2022, July 2022 Jul 1, 2022
@DonJayamanne DonJayamanne modified the milestones: July 2022, June 2022 Jul 3, 2022
@amunger amunger added verified Verification succeeded and removed verification-found Issue verification failed labels Jul 5, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 6, 2023
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 ipywidgets Rendering, loading, saving, anything to do with IPyWidgets verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

6 participants