# Displaying IPython Widgets

**URL:** <https://discourse.julialang.org/t/displaying-ipython-widgets/6755>\
**Category:** General Usage\
**Created:** [October 29, 2017, 3:42pm UTC](https://discourse.julialang.org/t/displaying-ipython-widgets/6755 "2017-10-29T15:42:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cortner](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cortner/32/204_2.png) [@cortner](https://discourse.julialang.org/u/cortner)\
**Post date:** [October 29, 2017, 3:42pm UTC](https://discourse.julialang.org/t/displaying-ipython-widgets/6755/1 "2017-10-29T15:42:23Z")

</div>

I am using the Python package [nglview](https://github.com/arose/nglview) to create a visualisation. The object it generates is a `PyObject <nglview.widget.NGLWidget ...>` and looking at the source-code of `nglview` this is a subclass of `ipywidgets.DOMWidget`. When trying to display it using

```julia
@pyimport nglview as nv
@pyimport IPython.display as ipydisp
ipydisp.display(nv.show_ase(si)). # `si` is a `PyObject` which can be visualised using nglview

```

This generates the error message

```julia
Widget Javascript not detected. It may not be installed or enabled properly.

```

The same code works fine from a Python notebook. Can anybody advise?

I am trying to put together a MWE (the current example requires a lot of dependencies) and will post it here if I succeed.

---

<div class="post-metadata">

**Author:** ![cortner](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cortner/32/204_2.png) [@cortner](https://discourse.julialang.org/u/cortner)\
**Post date:** [October 29, 2017, 8:13pm UTC](https://discourse.julialang.org/t/displaying-ipython-widgets/6755/2 "2017-10-29T20:13:29Z")

</div>

A MWE - requires `nglview` which can be installed via

```julia
pip install nglview
jupyter-nbextension enable nglview --py --sys-prefix

```

In Python:

```python
import nglview as nv
view = nv.show_pdbid("1l2y")
view

```

In Julia:

```julia
using PyCall
@pyimport nglview as nv
@pyimport IPython.display as ipydisp
view = nv.show_pdbid("1l2y")
ipydisp.display(view)

```

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [October 30, 2017, 12:12pm UTC](https://discourse.julialang.org/t/displaying-ipython-widgets/6755/3 "2017-10-30T12:12:16Z")

</div>

Not supported by PyCall yet:

[https://github.com/JuliaPy/PyCall.jl/issues/89](https://github.com/JuliaPy/PyCall.jl/issues/89)

In principle it is possible, but no one has gotten around to implementing it.
