ContinuumIO / anaconda-issues

Anaconda issue tracking
646 stars 220 forks source link

htmlwidgets not working rendering in Jupyter with IRKernel #3902

Open kushukla opened 6 years ago

kushukla commented 6 years ago

Hi,

I did a fresh installation of following on "OS X El Capitan version 10.11.6"

Although DT::datatable(iris) works fine on RStudio, but on Jupyter it silently breaks. Nothing happens, any print statement after that doesn't work.

Next, I tried PivotTable, using rpivotTable::rpivotTable(data = mtcars) this also renders nicely in RStudio but on Jupyter it displays HTML widgets cannot be represented in plain text (need html). The class of this object was 'rpivotTable' 'htmlwidget'.

Some more debugging stuff:

Both the below statements returns TRUE

'text/html' %in% getOption('jupyter.display_mimetypes')
getOption("jupyter.rich_display")

Here are the packages:

$ conda list --show-channel-urls
# packages in environment at /Users/kushukla/miniconda3:
#
appnope                   0.1.0                    py36_0    defaults
asn1crypto                0.22.0                   py36_0    defaults
bleach                    1.5.0                    py36_0    defaults
cffi                      1.10.0                   py36_0    defaults
conda                     4.3.23                   py36_0    defaults
conda-env                 2.6.0                         0    defaults
cryptography              1.8.1                    py36_0    defaults
decorator                 4.1.2                    py36_0    defaults
entrypoints               0.2.3                    py36_0    defaults
html5lib                  0.999                    py36_0    defaults
icu                       54.1                          0    defaults
idna                      2.5                      py36_0    defaults
ipykernel                 4.6.1                    py36_0    defaults
ipython                   6.1.0                    py36_0    defaults
ipython_genutils          0.2.0                    py36_0    defaults
ipywidgets                6.0.0                    py36_0    defaults
jedi                      0.10.2                   py36_2    defaults
jinja2                    2.9.6                    py36_0    defaults
jsonschema                2.6.0                    py36_0    defaults
jupyter                   1.0.0                    py36_3    defaults
jupyter_client            5.1.0                    py36_0    defaults
jupyter_console           5.1.0                    py36_0    defaults
jupyter_core              4.3.0                    py36_0    defaults
markupsafe                0.23                     py36_2    defaults
mistune                   0.7.4                    py36_0    defaults
nbconvert                 5.2.1                    py36_0    defaults
nbformat                  4.3.0                    py36_0    defaults
notebook                  5.0.0                    py36_0    defaults
openssl                   1.0.2l                        0    defaults
packaging                 16.8                     py36_0    defaults
pandoc                    1.19.2.1                      0    defaults
pandocfilters             1.4.1                    py36_0    defaults
path.py                   10.3.1                   py36_0    defaults
pexpect                   4.2.1                    py36_0    defaults
pickleshare               0.7.4                    py36_0    defaults
pip                       9.0.1                    py36_1    defaults
prompt_toolkit            1.0.14                   py36_0    defaults
ptyprocess                0.5.2                    py36_0    defaults
pycosat                   0.6.2                    py36_0    defaults
pycparser                 2.17                     py36_0    defaults
pygments                  2.2.0                    py36_0    defaults
pyopenssl                 17.0.0                   py36_0    defaults
pyparsing                 2.1.4                    py36_0    defaults
pyqt                      5.6.0                    py36_2    defaults
python                    3.6.1                         2    defaults
python-dateutil           2.6.1                    py36_0    defaults
pyzmq                     16.0.2                   py36_0    defaults
qt                        5.6.2                         2    defaults
qtconsole                 4.3.0                    py36_0    defaults
readline                  6.2                           2    defaults
requests                  2.14.2                   py36_0    defaults
ruamel_yaml               0.11.14                  py36_1    defaults
setuptools                27.2.0                   py36_0    defaults
simplegeneric             0.8.1                    py36_1    defaults
sip                       4.18                     py36_0    defaults
six                       1.10.0                   py36_0    defaults
sqlite                    3.13.0                        0    defaults
terminado                 0.6                      py36_0    defaults
testpath                  0.3.1                    py36_0    defaults
tk                        8.5.18                        0    defaults
tornado                   4.5.1                    py36_0    defaults
traitlets                 4.3.2                    py36_0    defaults
wcwidth                   0.1.7                    py36_0    defaults
wheel                     0.29.0                   py36_0    defaults
widgetsnbextension        2.0.0                    py36_0    defaults
xz                        5.2.2                         1    defaults
yaml                      0.1.6                         0    defaults
zlib                      1.2.8                         3    defaults

Here is another one:

$ conda list -e
# This file may be used to create an environment using:
# $ conda create --name <env> --file <this file>
# platform: osx-64
appnope=0.1.0=py36_0
asn1crypto=0.22.0=py36_0
bleach=1.5.0=py36_0
cffi=1.10.0=py36_0
conda=4.3.23=py36_0
conda-env=2.6.0=0
cryptography=1.8.1=py36_0
decorator=4.1.2=py36_0
entrypoints=0.2.3=py36_0
html5lib=0.999=py36_0
icu=54.1=0
idna=2.5=py36_0
ipykernel=4.6.1=py36_0
ipython=6.1.0=py36_0
ipython_genutils=0.2.0=py36_0
ipywidgets=6.0.0=py36_0
jedi=0.10.2=py36_2
jinja2=2.9.6=py36_0
jsonschema=2.6.0=py36_0
jupyter=1.0.0=py36_3
jupyter_client=5.1.0=py36_0
jupyter_console=5.1.0=py36_0
jupyter_core=4.3.0=py36_0
markupsafe=0.23=py36_2
mistune=0.7.4=py36_0
nbconvert=5.2.1=py36_0
nbformat=4.3.0=py36_0
notebook=5.0.0=py36_0
openssl=1.0.2l=0
packaging=16.8=py36_0
pandoc=1.19.2.1=0
pandocfilters=1.4.1=py36_0
path.py=10.3.1=py36_0
pexpect=4.2.1=py36_0
pickleshare=0.7.4=py36_0
pip=9.0.1=py36_1
prompt_toolkit=1.0.14=py36_0
ptyprocess=0.5.2=py36_0
pycosat=0.6.2=py36_0
pycparser=2.17=py36_0
pygments=2.2.0=py36_0
pyopenssl=17.0.0=py36_0
pyparsing=2.1.4=py36_0
pyqt=5.6.0=py36_2
python=3.6.1=2
python-dateutil=2.6.1=py36_0
pyzmq=16.0.2=py36_0
qt=5.6.2=2
qtconsole=4.3.0=py36_0
readline=6.2=2
requests=2.14.2=py36_0
ruamel_yaml=0.11.14=py36_1
setuptools=27.2.0=py36_0
simplegeneric=0.8.1=py36_1
sip=4.18=py36_0
six=1.10.0=py36_0
sqlite=3.13.0=0
terminado=0.6=py36_0
testpath=0.3.1=py36_0
tk=8.5.18=0
tornado=4.5.1=py36_0
traitlets=4.3.2=py36_0
wcwidth=0.1.7=py36_0
wheel=0.29.0=py36_0
widgetsnbextension=2.0.0=py36_0
xz=5.2.2=1
yaml=0.1.6=0
zlib=1.2.8=3

Here is R Session:

R version 3.4.1 (2017-06-30)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: OS X El Capitan 10.11.6

Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib

locale:
[1] C/UTF-8/C/C/C/C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] plotly_4.7.1      ggplot2_2.2.1     repr_0.12.0       DT_0.2           
[5] rpivotTable_0.2.0

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.12        compiler_3.4.1      plyr_1.8.4         
 [4] bindr_0.1           tools_3.4.1         digest_0.6.12      
 [7] uuid_0.1-2          viridisLite_0.2.0   jsonlite_1.5       
[10] evaluate_0.10.1     tibble_1.3.3        gtable_0.2.0       
[13] pkgconfig_2.0.1     rlang_0.1.1         shiny_1.0.3        
[16] IRdisplay_0.4.4     crosstalk_1.0.0     IRkernel_0.8.7.9000
[19] yaml_2.1.14         bindrcpp_0.2        stringr_1.2.0      
[22] dplyr_0.7.2         httr_1.2.1          htmlwidgets_0.9    
[25] grid_3.4.1          glue_1.1.1          data.table_1.10.4  
[28] R6_2.2.2            pbdZMQ_0.2-6        tidyr_0.6.3        
[31] purrr_0.2.2.2       magrittr_1.5        scales_0.4.1       
[34] htmltools_0.3.6     assertthat_0.2.0    xtable_1.8-2       
[37] mime_0.5            colorspace_1.3-2    httpuv_1.3.5       
[40] stringi_1.1.5       lazyeval_0.2.0      munsell_0.4.3      
[43] crayon_1.3.2  

I wonder what could be cause of this issue.

Thanks, Kunal

mingwandroid commented 6 years ago

Are you using Firefox? If so try Chrome or Safari instead.

kushukla commented 6 years ago

I tried Chrome Version 60.0.3112.78 (Official Build) (64-bit) and Safari version 10.1.2 both have same issue.

mingwandroid commented 6 years ago

Do you have ad blockers enabled?

kushukla commented 6 years ago

No, Chrome ad-blocker doesn't show any blocked pages.

mingwandroid commented 6 years ago

Can you disable it entirely though?

Also you may find some hints here: https://github.com/ContinuumIO/anaconda-issues/issues/1391

Since you are only using some parts of conda here (notably the R stuff is not from conda) I won't spend any more time digging into it, sorry about that.

kushukla commented 6 years ago

Disabling as-blocker didn't help. Anyways thanks for your response :)

mingwandroid commented 6 years ago

R 3.4.1 and RStudio 1.0.153 are now available for macOS on the conda r channel if you want to try that.

steverweber commented 6 years ago

others are also having the issue... haven't seen a solution yet

https://github.com/ContinuumIO/anaconda-issues/issues/1391 https://github.com/IRkernel/IRkernel/issues/492

flying-sheep commented 6 years ago

Hi, I fixed the recursion problem in IRkernel/IRkernel@6d8bb10f39265b990dd3383d5ea6f894c8aaaf69.

this should give you a HTML representation. but beware that jupyter/notebook#1282 might happen, resulting in a 1px high iframe.

maybe also relevant: bokeh/rbokeh#199