nglviewer / nglview

Jupyter widget to interactively view molecular structures and trajectories
http://nglviewer.org/nglview/latest/
Other
816 stars 133 forks source link

Unable to run nglview in my browsers #1076

Closed Ash100 closed 1 year ago

Ash100 commented 1 year ago

Hello, I am sorry for asking such a basic question here. I am trying to run nglview in Jupyter Notebook using Chrome. I am able to run all the scripts successfully without an error, but still unable to visualize anything. Below are the scripts, I tried. !pip install Bio !pip install nglview !pip install "ipywidgets>=7,<8" `from google.colab import output output.enable_custom_widget_manager()

import ipywidgets as widgets from IPython.display import display import os import sys from urllib.request import urlretrieve import Bio from Bio import PDB from Bio import SeqIO, SearchIO, Entrez from Bio.Seq import Seq import pylab import urllib import pandas as pd import nglview as nv from collections import Counter from Bio.PDB import PDBParser,MMCIFParser urllib.request.urlretrieve('https://files.rcsb.org/download/4I5S.pdb','4I5S.pdb') structure = PDB.PDBParser().get_structure("4I5S", "4I5S.pdb") view=nv.show_biopython(structure) view`

I think I am so how unable to successfully enable the third part widgets in chrome, but it is what i am thinking. I would be thankful, if someone can help fix my issue- i suppose won't be that bigger. Best Regards, Ash

hainm commented 1 year ago

hi @Ash100, can you try to use nglview v3.0.6 instead? There is something wrong with the latest v3.0.7.

hainm commented 1 year ago

I've released 3.0.8. Please try again.

Ash100 commented 1 year ago

Thank you so much. At least I am able now to call nglview but still, I am unable to turn on the gui = True. At times it stays silent while other times, it is asking to enable widgets, though they are enabled and I am not seeing that warning on importing nglview as nv.

hainm commented 1 year ago

Can you please capture your screen?

May be try

view = nv.demo() view.gui_style = “ngl” view

first.

Ash100 commented 1 year ago

view.gui_style = 'ngl' --- it works fine and generates GUI controls view = nv.demo() ---- generates warning message from code snipet "enable_custome_widget_manager nv.show_biopython(structure, gui=True) ---- visualize structure with out GUI controls

I am trying to drop these three screenshots from the same notebook below 1 2 3

hainm commented 1 year ago

Thanks. It seems like it’s a problem with google colab. You can try again with traditional notebook in your computer.

Ash100 commented 1 year ago

Sure. Thank you @hainm for your support. In fact, the problem is solved. You can close the issue.