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

Incompatibility of jupyter-matplotlib with nglview #80

Open
sperezconesa opened this issue May 22, 2019 · 10 comments
Open

Incompatibility of jupyter-matplotlib with nglview #80

sperezconesa opened this issue May 22, 2019 · 10 comments

Comments

@sperezconesa
Copy link

Dear jupyter comunity,
I have installed the widget as follows:

 9170  source bin/anaconda3/bin/activate

 9172  bin/anaconda3/bin/conda create --name lab

 9174  source bin/anaconda3/bin/activate lab

 9179  conda install jupyterlab MDAnalysis sympy matplotlib

 9180  conda update -all

 9181  conda update --all

 9182  conda install -c conda-forge ipympl widgetsnbextension

 9183  conda install nodejs

 9184  jupyter labextension install @jupyter-widgets/jupyterlab-manager

 9185  jupyter labextension install jupyter-matplotlib

 9186  jupyter-lab

At this point it works well. But when I install nglview (https://github.com/arose/nglview). Doing:

pip install nglview==1.1.9
jupyter-labextension install nglview-js-widgets@1.1.9

The zooming in and moving the graph does not work anymore. In the java console when I execute the cell I get
Screenshot_20190522_160755

@thomasaarholt
Copy link
Contributor

Hi @sperezconesa, could you confirm that nglview works for you without installing ipympl?

Also, I think we need clearer information. When you say "At this point it works well.", what is it that works well? Be super clear in your issue :)

@sperezconesa
Copy link
Author

I mean it works perfectly, the buttons, the zooming and everything. Nglview does not need ipympl. Let me know if I can give you any more information.

@sperezconesa
Copy link
Author

These are the versions in use:
ipykernel 5.1.1 py37h24bf2e0_0 conda-forge
ipympl 0.2.1 py37_1001 conda-forge
ipython 7.5.0 py37h24bf2e0_0 conda-forge
ipython_genutils 0.2.0 py_1 conda-forge
ipywidgets 7.4.2 py_0 conda-forge
jupyter_client 5.2.4 py_3 conda-forge
jupyter_core 4.4.0 py_0 conda-forge
jupyterlab 0.35.6 py37_0 conda-forge
jupyterlab_server 0.2.0 py_0 conda-forge
matplotlib 3.1.0 py37_0 conda-forge
matplotlib-base 3.1.0 py37h5f35d83_0 conda-forge
nglview 2.1.0 pypi_0 pypi
nodejs 11.14.0 he1b5a44_1 conda-forge
notebook 5.7.8 py37_0 conda-forge
python 3.7.3 h5b0a415_0 conda-forge
python-dateutil 2.8.0 py_0 conda-forge
widgetsnbextension 3.4.2 pypi_0 pypi

@hainm
Copy link

hainm commented May 29, 2019

I can only reproduce the issue in jupyterlab. nglview and matplotlib work fine together in traditional notebook.

@hainm
Copy link

hainm commented May 29, 2019

image

may be those lines from nglview caused the issue (?)
https://github.com/arose/nglview/blob/405a46a3f72311bce7bf1aec572dfb93eb26b285/js/src/widget_ngl.js#L10-L15

var Jupyter;
if (typeof window !== 'undefined') {
  Jupyter = window['Jupyter'] = window['Jupyter'] || {};
} else {
  Jupyter = Jupyter || {};
}

@sperezconesa
Copy link
Author

Thank you very much @hainm ! Unfortunately I cannot help you solve the problem, this kind of programing is over my abilities. I can only give you information. If there is anything else I can do, let me know.

@hainm
Copy link

hainm commented May 30, 2019

Yeah, I should do that in next release.

@hainm
Copy link

hainm commented Jun 22, 2019

@sperezconesa Please try again with nglview v.2.20. cheers.

@sperezconesa
Copy link
Author

Awesome! now it works!
Thanks a lot.
By the way, the README.md of nglview does not incorporate how to install it in jupyterlab. You have to dig around. This probably should be updated.

@hainm
Copy link

hainm commented Jun 24, 2019

By the way, the README.md of nglview does not incorporate how to install it in jupyterlab.

hi, it's intention. cheers. By the way, you can close this issue. thanks.

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

3 participants