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

Graphics window seems to be "broken" #915

Closed
sneshyba opened this issue Jul 15, 2020 · 4 comments
Closed

Graphics window seems to be "broken" #915

sneshyba opened this issue Jul 15, 2020 · 4 comments

Comments

@sneshyba
Copy link

sneshyba commented Jul 15, 2020

I'm using jupyter on ubuntu (via jupyterhub), a notebook with %matplotlib notebook selected. And while nglview.show_structure_file is trying to do something, all get is this broken graphics window. Sorry, I'm new to this, not sure if the image below will paste properly.

image

@hainm
Copy link
Collaborator

hainm commented Jul 15, 2020

hi @sneshyba, you need to display the 3D viewer before rendering it.

# cell 1
view = ...
view # live

# cell 2
view.render_image()

# cell 3
view._display_image() # just for displaying in static notebook. 

Please check this example: https://github.com/arose/nglview/raw/master/examples/images/membrane.gif

@sneshyba
Copy link
Author

Yes, I had done that before. The results are similar, but still not rendered:

image

image

@hainm
Copy link
Collaborator

hainm commented Jul 15, 2020

@sneshyba did you follow the install guide here? https://github.com/arose/nglview#released-version

If you did, please read further here: https://github.com/arose/nglview/blob/master/docs/FAQ.md#widget-not-shown

@sneshyba
Copy link
Author

I did -- but then I re-checked and realized that enabling nglview had given a permission error. So I used sudo and that solved it!

jupyter-nbextension enable nglview --py --sys-prefix (gave a permission error)
sudo jupyter-nbextension enable nglview --py --sys-prefix (worked)

Thank you so much! I'm really liking MDAnalysis, especially since my students are not able to get in front of a workstation easily -- now they can do a lot more remotely.

I still have to figure out how to display my .gro files properly -- but I think that's a different ticket.

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

2 participants