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

Empty view problem again #726

Closed
davidlmobley opened this issue Jan 5, 2018 · 60 comments
Closed

Empty view problem again #726

davidlmobley opened this issue Jan 5, 2018 · 60 comments

Comments

@davidlmobley
Copy link

I'm having an "empty view" problem again where I attempt to load the 3pqr example and display it, and a view pops up, but nothing shows up in the view. I've gone through the usage question stuff in #589 but don't see my specific problem, and I've done multiple uninstalls/reinstalls per https://github.com/SBRG/ssbio/wiki/Troubleshooting#nglviewer-fresh-install-tips with no success.

This is in a fresh version of Ubuntu 16.04 LTS and I've installed everything via conda; environment details below.

It may or may not be related, but I also noted a couple of weeks ago (in a separate install) that the bioconda version of nglview worked properly but the conda-forge version was resulting in an error (though I'm not seeing that presently). I've also verified (per the troubleshooting info) that ipywidgets displays "hello" properly when asked. I DO have nglview working properly on other machines following (from what I can tell) the exact same series of steps, but on OS X rather than linux. So presumably it's something "special" about this particular installation, but I'm lost as to how to troubleshoot further.

Version report:

alabaster 0.7.10 py36h306e16b_0
ambermini 16.16.0 7 omnia
asn1crypto 0.23.0 py36h4639342_0
attrs 17.3.0 py36h5ab58ff_0
babel 2.5.0 py36h7d14adf_0
bleach 2.1.1 py36hd521086_0
bzip2 1.0.6 h6d464ef_2
ca-certificates 2017.11.5 0 conda-forge
certifi 2017.11.5 py36_0 conda-forge
cffi 1.11.2 py36h2825082_0
chardet 3.0.4 py36h0f667ec_1
cloog 0.18.1 1 serge-sans-paille
clusterutils 0.3.1 py36_0 omnia
coverage 4.3.4 py36_0 omnia
cryptography 2.1.4 py36hd09be54_0
curl 7.55.1 h78862de_4
cycler 0.10.0 py36h93f1223_0
cython 0.27.3 py36h1860423_0
dbus 1.10.22 h3b5a359_0
decorator 4.1.2 py36hd076ac8_0
docopt 0.6.2 py36_1 omnia
docutils 0.14 py36hb0f60f5_0
entrypoints 0.2.3 py36h1aec115_2
expat 2.2.5 he0dffb1_0
fftw3f 3.3.4 2 omnia
fontconfig 2.12.4 h88586e7_1
freetype 2.8 hab7d2ae_1
gcc_49 4.9.1 6 serge-sans-paille
glib 2.53.6 h5d9569c_2
gmp 5.1.3 0 serge-sans-paille
gst-plugins-base 1.12.2 he3457e5_0
gstreamer 1.12.2 h4f93127_0
hdf4 4.2.13 h3ca952b_2
hdf5 1.10.1 h9caa474_1
html5lib 1.0.1 py36h2f9c1c0_0
hypothesis 3.38.5 py36h196a6cc_0
icu 58.2 h9c2bf20_1
idna 2.6 py36h82fb2a8_1
imagesize 0.7.1 py36h52d8127_0
intel-openmp 2018.0.0 hc7b2577_8
ipykernel 4.7.0 py36h2f9c1c0_0
ipython 6.2.1 py36h88c514a_1
ipython_genutils 0.2.0 py36hb52b0d5_0
ipywidgets 7.1.0 py36_0 conda-forge
isl 0.12.2 0
jedi 0.11.0 py36_2
jinja2 2.10 py36ha16c418_0
jpeg 9b h024ee3a_2
jsonschema 2.6.0 py36h006f8b5_0
jupyter 1.0.0
jupyter 1.0.0 py36h9896ce5_0
jupyter_client 5.1.0 py36h614e9ea_0
jupyter_console 5.2.0 py36he59e554_1
jupyter_core 4.4.0 py36h7c827e3_0
latexcodec 1.0.1 py36_0 omnia
libedit 3.1 heed3624_0
libffi 3.2.1 hd88cf55_4
libgcc 7.2.0 h69d50b8_2
libgcc-ng 7.2.0 h7cc24e2_2
libgfortran 3.0.0 1
libgfortran-ng 7.2.0 h9f7466a_2
libnetcdf 4.4.1.1 h816af47_8
libpng 1.6.32 hbd3595f_4
libsodium 1.0.15 hf101ebd_0
libssh2 1.8.0 h2d05a93_3
libstdcxx-ng 7.2.0 h7a57d05_2
libxcb 1.12 hcd93eb1_4
libxml2 2.9.4 h2e8b1d7_6
libxslt 1.1.29 h78d5cac_6
lxml 4.1.1 py36h4d89739_0
lzo 2.10 h49e0be7_2
markupsafe 1.0 py36hd9260cd_1
matplotlib 2.1.1 py36ha26af80_0
mdtraj 1.9.1 py36_0 omnia
mistune 0.8.1 py36h3d5977c_0
mkl 2018.0.1 h19d6760_4
mpc 1.0.3 hf803216_4
mpfr 3.1.5 h12ff648_1
mpi4py 2.0.0 py36_2 omnia
mpich 3.2 4 omnia
nbconvert 5.3.1 py36hb41ffb7_0
nbformat 4.4.0 py36h31c9010_0
ncurses 6.0 h9df7e31_2
netcdf4 1.3.1 py36hfd655bd_2
networkx 2.0 py36h7e96fb8_0
nglview 1.0 py36_1 conda-forge
notebook 5.2.2 py36h40a37e6_0
numexpr 2.6.4 py36hc4a3f9a_0
numpy 1.12.1 py36he24570b_1
numpydoc 0.7.0 py36h18f165f_0
oeommtools 0.0.7 py36_0 OpenEye/label/Orion
OpenEye-oenotebook 0.8.1
OpenEye-toolkits 2017.10.1
OpenEye-toolkits-python3-linux-x64 2017.10.1
openforcefield 0.0.3 py36_1 omnia
openmm 7.1.1 py36_0 omnia
openmmtools 0.13.4 py36_0 omnia
openmoltools 0.8.1 py36_0 omnia
openssl 1.0.2n 0 conda-forge
oset 0.1.3 py36_1 omnia
packmol 1.0.0 2 omnia
pandas 0.21.1 py36h20b78c2_0
pandoc 1.19.2.1 hea2e7c5_1
pandocfilters 1.4.2 py36ha6701b7_1
parmed 2.7.3 py36_1 omnia
parso 0.1.1 py36h35f843b_0
pcre 8.41 hc27e229_1
pdbfixer 1.4 py36_0 omnia
pexpect 4.3.0 py36h673ed17_0
pickleshare 0.7.4 py36h63277f8_0
pip 9.0.1 py36h6c6f9ce_4
pluggy 0.6.0 py36hb689045_0
prompt_toolkit 1.0.15 py36h17d85b1_0
ptyprocess 0.5.2 py36h69acd42_0
py 1.5.2 py36h29bf505_0
pybtex 0.18 py36_0 omnia
pybtex-docutils 0.2.1 py36_1 omnia
pycparser 2.18 py36hf9f622e_1
pygments 2.2.0 py36h0d3125c_0
pymbar 3.0.1.beta0 np112py36_0 omnia
pympler 0.5 py36h6b12e4d_0
pyopenssl 17.5.0 py36h20ba746_0
pyparsing 2.2.0 py36hee85983_1
pyqt 5.6.0 py36h0386399_5
pysocks 1.6.7 py36hd97a5b1_1
pytables 3.4.2 py36h3b5282a_2
pytest 3.3.0 py36h23ce9bc_0
python 3.6.4 hc3d631a_0
python-dateutil 2.6.1 py36h88d3b88_1
pytz 2017.3 py36h63b9c63_0
pyyaml 3.12 py36hafb9ca4_1
pyzmq 16.0.3 py36he2533c7_0
qt 5.6.2 h974d657_12
qtconsole 4.3.1 py36h8f73b5b_0
readline 7.0 ha6073c6_4
requests 2.18.4 py36he2e5f8d_1
schema 0.6.2 py36_0 omnia
scipy 1.0.0 py36hbf646e7_0
setuptools 36.5.0 py36he42e2e1_0
simplegeneric 0.8.1 py36h2cb9092_0
sip 4.18.1 py36h51ed4ed_2
six 1.11.0 py36h372c433_1
snowballstemmer 1.2.1 py36h6febd40_0
solvationtoolkit 0.4.2 py36_0 omnia
sphinx 1.6.3 py36he5f0bdb_0
sphinxcontrib 1.0 py36h6d0f590_1
sphinxcontrib-bibtex 0.3.2 py36_0 omnia
sphinxcontrib-websupport 1.0.1 py36hb5cb234_1
sqlite 3.20.1 hb898158_2
terminado 0.6 py36ha25a19f_0
testpath 0.3.1 py36h8cadb63_0
tk 8.6.7 hc745277_3
tornado 4.5.2 py36h1283b2a_0
traitlets 4.3.2 py36h674d592_0
typing 3.6.2 py36h7da032a_0
urllib3 1.22 py36hbe7ace6_0
wcwidth 0.1.7 py36hdf4376a_0
webencodings 0.5.1 py36h800622e_1
wheel 0.30.0 py36hfd4bba0_1
widgetsnbextension 3.1.0 py36_0 conda-forge
xz 5.2.3 h55aa19d_2
yaml 0.1.7 had09818_2
yank 0.18.0 py36_0 omnia
zeromq 4.2.2 hbedb6e5_2
zlib 1.2.11 ha838bed_2
zope 1.0 py36_0
zope.interface 4.4.3 py36h0ccbf34_0

@hainm
Copy link
Collaborator

hainm commented Jan 5, 2018

We are not responsible for the one in conda-forge. Please use the suggested version in bioconda channel: https://github.com/arose/nglview#released-version

@davidlmobley
Copy link
Author

I have the same issue with both versions presently, and tried the bioconda one first and repeatedly. I just tried conda forge as a final attempt before posting this issue.

@hainm
Copy link
Collaborator

hainm commented Jan 5, 2018

what does the browser console say?

@hainm
Copy link
Collaborator

hainm commented Jan 5, 2018

(try with bioconda version).

@hainm
Copy link
Collaborator

hainm commented Jan 9, 2018

@davidlmobley any news?

@davidlmobley
Copy link
Author

I will try and get you the output of the browser console soon. It's on a different computer and I was out of tow.

@hainm
Copy link
Collaborator

hainm commented Jan 9, 2018

Just curious: did you have the issue with Linux machine?

(I am getting the same issue with my Linux machine without any clue why. I normally work with MacOS).

@davidlmobley
Copy link
Author

Yes, this is Linux, under Ubuntu. I'm trying to use this for a class where several people have Ubuntu.

Oddly enough, I used it separately for a workshop in Linux some months ago in Chile and we did not have this problem. @davidsaezsan, @evohringer and Max Troncoso (can't find his ID at the moment) helped with that; I don't recall them mentioning this problem and we DID get it working using what I THOUGHT was exactly the same procedure I'm using now, but perhaps they have insights.

(This was under a fresh install of Ubuntu 16.04 LTS on a persistent USB installation on a thumb drive.)

@davidlmobley
Copy link
Author

@Maxriquelme

@hainm
Copy link
Collaborator

hainm commented Jan 9, 2018

uhm, I think this is a new symptom and I wanna cry if this this is true.

Basically, NGL require initial structure for rendering, and backend (python) send data (blob of text) to frontend (notebook rendering). For unknown reasons, NGL in your and my Linux machine won't be happy with the binary content.

get

@hainm
Copy link
Collaborator

hainm commented Jan 9, 2018

The quick fix in your computer is to change 'rb' to 'r' in this line: https://github.com/arose/nglview/blob/7554eece38989e41fbc6d84efa54f8e6d94f808d/nglview/utils/py_utils.py#L206

I totally forgot why I used 'rb' for that. lol.

@davidsaezsan
Copy link

davidsaezsan commented Jan 9, 2018 via email

@hainm
Copy link
Collaborator

hainm commented Jan 11, 2018

ok, so I know why now. This is due to changes in ipykernel. The newest version is 4.7.0 does not handle binary data well (IMO), downgrade to 4.6.1 would resolve the "not showing" issue.

  • Working version

screen shot 2018-01-11 at 12 25 52 am

  • NOT working version (the only difference is ipykernel version).

screen shot 2018-01-11 at 12 27 09 am

@hainm
Copy link
Collaborator

hainm commented Jan 11, 2018

related: ipython/ipykernel#289

@davidlmobley
Copy link
Author

Sounds plausible; thanks for tracking it down. So do you need to pin to the old version and update your conda recipe?

@hainm
Copy link
Collaborator

hainm commented Jan 11, 2018 via email

@davidlmobley
Copy link
Author

I can confirm that the downgrade fixes the issue. Thanks, I'll do that for now.

@RobertArbon
Copy link

RobertArbon commented Jan 12, 2018

Hi, your update didn't work on my system I'm afraid. I'm on OSX Sierra

My conda environment:
conda_list.txt

I tried using the demo (nv.demo) which didn't show up.

I also tried downgrading the ipykernel which didn't work either.

@hainm
Copy link
Collaborator

hainm commented Jan 12, 2018

hi,

my update is not merged to upstream yet. There is other issues with ipykernel 4.7 so I need more time to investigate.

The consensus (for now) is to use ipykernel 4.6 (yours is 4.7.0).

@hainm
Copy link
Collaborator

hainm commented Jan 12, 2018

I also tried downgrading the ipykernel which didn't work either.

I am pretty sure downgrade would help. Can you double check if you really downgrade?
If so, what does your web console say? (in chrome, right click then choose Inspect, then Console).

@hainm
Copy link
Collaborator

hainm commented Jan 12, 2018

:D The message say you don't have NGLModel, suggesting that the nglview-js-widgets is not updated properly. Please check this thread: #718 (comment)

Basically should try to remove all the old nglview-js-widgets in some locations. Sorry for the trouble.

@RobertArbon
Copy link

Thanks so much - that's worked! I had about 5 different nglview-js-widgets installed in different places.

@hainm hainm closed this as completed in d15afed Jan 14, 2018
hainm added a commit that referenced this issue Jan 14, 2018
hainm added a commit that referenced this issue Jan 14, 2018
@marscher
Copy link
Contributor

marscher commented Feb 13, 2018 via email

@hainm
Copy link
Collaborator

hainm commented Feb 13, 2018 via email

@hainm
Copy link
Collaborator

hainm commented Mar 24, 2018

nglview 1.1.2 will work with any ipykernel (hopefully).

@marscher
Copy link
Contributor

Any chance to automatize the testing? Eg. run nglview demo in an headless browser and check console output for any bad stuff? https://docs.travis-ci.com/user/gui-and-headless-browsers/

@hainm
Copy link
Collaborator

hainm commented Mar 25, 2018

I've tried to test notebook before, sometimes the tests works, sometimes doesn't (not sure why). PR is very welcome.

@hainm
Copy link
Collaborator

hainm commented Mar 25, 2018

@ppxasjsm
Copy link

ppxasjsm commented Mar 26, 2018

I appear to be having similar issues. According to @lohedges. He get's a working display with:
nglview: 1.0
numpy: 1.14.0
ipywidgets: 7.1.1
ipykernel: 4.8.0
jupyter: 1.0.0

I have tried to replicate this install and do not get a display (tried safari and chrome).
I tried the downgrade of the ipykernel to 4.6.1 which did not fix the problem for me.

My current install is:
traitlets 4.3.2
ipywidgets 7.1.1
notebook 5.4.1
numpy 1.14.2
ipykernel 4.8.0
nglview 1.1.2

@hainm
Copy link
Collaborator

hainm commented Mar 26, 2018 via email

@ppxasjsm
Copy link

I tried with nglview 1.1.2. Same issue. Latest try is the one mentioned above:
traitlets 4.3.2
ipywidgets 7.1.1
notebook 5.4.1
numpy 1.14.2
ipykernel 4.8.0
nglview 1.1.2

@marscher
Copy link
Contributor

Can you please try installing nglview from conda-forge as well?

conda install -c conda-forge nglview

@ppxasjsm
Copy link

Issue persists with the following install:
traitlets 4.3.2
ipywidgets 7.0.0
notebook 5.0.0
numpy 1.11.3
ipykernel 4.6.1
nglview 1.1.2

@hainm
Copy link
Collaborator

hainm commented Mar 26, 2018 via email

@ppxasjsm
Copy link

The second cell:
view._ngl_version

gives me an empty string as output.
I may have some version confusion between a pip install and conda. I'll take a look again later.

@ppxasjsm
Copy link

Small success. It is working ok on my linux box with the following versions and using the conda forge version:

traitlets 4.3.2
ipywidgets 7.1.0
notebook 5.2.2
numpy 1.14.0
ipykernel 4.7.0
nglview 1.1.2

On my Mac I am still having issues, but will see if I can fix that as well.

@hainm
Copy link
Collaborator

hainm commented Mar 26, 2018 via email

@salotz
Copy link

salotz commented May 1, 2018

I am also seeing the white screen of death for the 3pqr example. The demo works but I get '2.0.0-dev.28' from the version after I run the demo...

ipywidgets 7.2.1 py36_1 conda-forge
widgetsnbextension 3.2.1 py36_0 conda-forge
nglview 1.1.2 py36_1 bioconda
ipykernel 4.8.2 py36_0 conda-forge

Python 3.6.4
Ubuntu 16.04 LTS

I have removed all the .local repositories etc. following those and have activated all the jupyter extensions.
Chromium (65.0.3325.181 (Official Build)) console gives no errors but prints this:

STAGE LOG loading file ''
'CifParser._parse ' already exists
STAGE LOG loaded ''
THREE.WebGLRenderer 89
not able to actually render to 36193 texture
STAGE LOG loading file ''

Also tried on Firefox 59.0.2

If I get the html for the embed and load that up it gives me the little corner for resizing but still nothing.

@salotz
Copy link

salotz commented May 1, 2018

I actually think this is an error with nglview.show_pdbid because it works with demo and when I load a PDB file from my file system.

@ghost
Copy link

ghost commented Aug 4, 2020

I am still experiencing the problem on Jupyter Notebook. When using nglview.show_mdtraj I don't get any image.
Here:
Screenshot from 2020-08-04 11-10-50

How do I solve it? Thank you!
List of all packages and versions: py37_deepchem.txt
And my Ubuntu version is 18.04.4

@renee9904
Copy link

Screen Shot 2023-06-07 at 11 02 16 AM Hi, I run into this problem with using nglview in jupyter. It seems like I have successfully imported it into the working environment, and the version is 1.1.7. But the ```view``` does not present PDB file.

@hainm
Copy link
Collaborator

hainm commented Jun 7, 2023 via email

@renee9904
Copy link

It worked, thanks a lot!!!

@tmoughamer
Copy link

I am seeing this empty view issue with 3.0.8.

$ jupyter --version
Selected Jupyter core packages...
IPython          : 8.17.2
ipykernel        : 6.26.0
ipywidgets       : 8.1.1
jupyter_client   : 8.6.0
jupyter_core     : 5.5.0
jupyter_server   : 2.10.1
jupyterlab       : 4.0.9
nbclient         : 0.8.0
nbconvert        : 7.11.0
nbformat         : 5.9.2
notebook         : 7.0.6
qtconsole        : 5.5.1
traitlets        : 5.13.0

@hainm
Copy link
Collaborator

hainm commented Jan 4, 2024

@tmoughamer can you please post your screenshot? (in the future, it would be better to open a new issue rather commenting in a closed one).

@tmoughamer
Copy link

nglv_jup

@hainm
Copy link
Collaborator

hainm commented Jan 5, 2024

nglv_jup

@tmoughamer oh, it's a known issue for that show_pdbid. Other functions should work (e.g nv.show_structure_file("./abc.pdb")

I am currently having a fix in #1086

@tmoughamer
Copy link

Thanks. That works (show_structure_file). However, I had tried the show_file function before which does produce and empty view for me. This will get me going.

@hainm
Copy link
Collaborator

hainm commented Jan 5, 2024

show_file

yeah, I get your point. It's due to show_structure_file send a blob of file content to NGL for rendering while show_file send a filename path (if the file is in current or subfolder). It used to work in regular notebook but not in lab. However, lab infrastructure is used for notebook, so show_file doesn't work for notebook either.

I will keep this in mind (and it's indeed annoying to see things not working).

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

9 participants