GibbsConsulting / jupyter-plotly-dash

Jupyter notebook wrapper for plotly dash applications
GNU Affero General Public License v3.0
81 stars 12 forks source link

404 error #6

Open viogp opened 5 years ago

viogp commented 5 years ago

Hi,

I created several jupyter notebooks using dash through your jupyter-plotly-dash. They were working fine in a Windows 10 computer, however they don't work on a machine running Ubuntu 18.04.1 and jupyter-notebook 5.7.0. I get a 404 error. One of my notebooks can be found here:

https://github.com/FaradayInstitution/intro2dash/blob/master/0_intro_plotly.ipynb

I also tried the example you provided and I get the same issue.

The python versions work just fine.

To me it seems it is a problem with the interface with dash. Here there is the error message I get: [W 14:27:22.342 NotebookApp] 404 GET /app/endpoints/f72d508283e84f7a9466f07f362e59e2 (127.0.0.1) 14.39ms referer=http://localhost:8986/notebooks/1_dash_install_html.ipynb [W 14:27:22.345 NotebookApp] 404 GET /app/endpoints/49a3c61147314a16ba47c4ecda8055c1 (127.0.0.1) 1.90ms referer=http://localhost:8986/notebooks/1_dash_install_html.ipynb [I 14:27:22.776 NotebookApp] Adapting to protocol v5.1 for kernel b206794b-3f32-48cf-a42a-9bddcd452557 [I 14:27:29.785 NotebookApp] 302 GET /app/endpoints/5fd1af7696cf45469ab252fc4f325aaa/ (127.0.0.1) 0.56ms [W 14:27:29.833 NotebookApp] 404 GET /app/endpoints/5fd1af7696cf45469ab252fc4f325aaa (127.0.0.1) 1.58ms referer=http://localhost:8986/notebooks/1_dash_install_html.ipynb [I 14:27:29.848 NotebookApp] 302 GET /app/endpoints/25fe344586c64319a507390055b10d70/ (127.0.0.1) 0.50ms [W 14:27:29.895 NotebookApp] 404 GET /app/endpoints/25fe344586c64319a507390055b10d70 (127.0.0.1) 1.51ms referer=http://localhost:8986/notebooks/1_dash_install_html.ipynb

I hope you can help with this issue.

Thanks in advance.

GibbsConsulting commented 5 years ago

A new version (0.1.0) has just been pushed to pypi. There are a lot of changes driven by changes in the underlying packages. Can you try this version and see if the problem persists?

shaunstoltz commented 5 years ago

Same issue, dosnt work.

GibbsConsulting commented 5 years ago

This is with v0.1.0? Are you in a position to provide (a) any error messages returned and (b) the output from !pip freeze evaluated in the notebook?

mkhorton commented 5 years ago

I'm also getting a 404 : Not Found You are requesting a page that does not exist! error with jupyter-plotly-dash v0.1.1 and JupyterLab 0.33.12 (I also had an issue with an older version of JupyterLab but updated it just to be sure).

This is the error in the terminal:

⡀ @jupyterlab/plotly-extension@file:../extensions/jupyterlab-plotly-extension-0.18.0.tgz[W 12:00:11.634 LabApp] 404 GET /files/app/endpoints/5889ebf6f9b14e7295f1be63f7c56c5c?1543435211535 (::1) 1.87ms referer=http://localhost:8888/lab
⠂ @jupyterlab/plotly-extension@file:../extensions/jupyterlab-plotly-extension-0.18.0.tgz[IPKernelApp] ERROR | Exception in comm_msg for 7655ae4d0b6f49f3bdd685db493c0b7b
Traceback (most recent call last):
  File "/Users/work/.venv/dash-components/lib/python3.7/site-packages/ipykernel/comm/manager.py", line 111, in comm_msg
    comm.handle_msg(msg)
  File "/Users/work/.venv/dash-components/lib/python3.7/site-packages/ipykernel/comm/comm.py", line 159, in handle_msg
    self._msg_callback(msg)
  File "/Users/work/.venv/dash-components/lib/python3.7/site-packages/jupyter_plotly_dash/nbkernel.py", line 21, in callback
    stem = data['stem']
KeyError: 'stem'
delsim commented 5 years ago

I just tried the following steps (on a Linux Mint 18 machine):

virtualenv env -p python3.6 source env/bin/activate pip install jupyter-plotly-dash jupyterlab

This gave me an environment that has working behaviour from jupyter-plotly-dash in both jupyter-notebook and jupyter-lab environments. I used as an example this notebook from the master branch.

Evaluating a cell containing !jupyter serverextension list

gives me:

config dir: /home/delsim/local/tmp/jpd_test/env/etc/jupyter jupyter_plotly_dash.serverext enabled

  • Validating... jupyter_plotly_dash.serverext OK nbserverproxy enabled
  • Validating... nbserverproxy OK jupyterlab enabled
  • Validating... jupyterlab 0.35.4 OK

I will try to install Python 3.7 and see if that makes any difference. Can you report what the jupyter serverextension list command returns?

mkhorton commented 5 years ago

!jupyter serverextension list gives me:

config dir: /usr/local/etc/jupyter
    jupyterlab  enabled 
    - Validating...
      jupyterlab 0.33.12 OK

Which makes me think it might be a very basic error, which is that the extension was installed in my venv when I should have installed it globally instead.

mkhorton commented 5 years ago

Trying to install it globally still gives an error however, and !jupyter serverextension list gives:

config dir: /usr/local/etc/jupyter
    nbserverproxy  enabled
    - Validating...
Error loading server extension nbserverproxy
      X is nbserverproxy importable?
    jupyter_plotly_dash.serverext  enabled
    - Validating...
Error loading server extension jupyter_plotly_dash.serverext
      X is jupyter_plotly_dash.serverext importable?
    jupyterlab  enabled
    - Validating...
      jupyterlab 0.33.12 OK

To be very explicit, my usual way of using JupyterLab is to run it from a global install, but to select a specific virtual env as a kernel.

GibbsConsulting commented 5 years ago

If nbserverproxy isn't installed and loading correctly, then I wouldn't expect things to work, as it is requirement.

Are you able to try things self-contained within a single virtualenv? The steps shouldn't be much more than

cd some/temporary/location virtualenv env -p python3.7 source env/bin/activate pip install jupyter-plotly-dash jupyterlab

and then launch jupyterlab and try it.

mpbrigham commented 5 years ago

Hi there! I have a similar environment with nbserverproxy installed but also getting 404 error message for the dash app example.

config dir: /share/tools3/etc/jupyter
    jupyter_plotly_dash.serverext  enabled 
    - Validating...
      jupyter_plotly_dash.serverext  OK
    nbserverproxy  enabled 
    - Validating...
      nbserverproxy  OK
    jupyterlab  enabled 
    - Validating...
      jupyterlab 0.34.2 OK'
GibbsConsulting commented 5 years ago

Are you able to share some more information about your environment?

mpbrigham commented 5 years ago

Well, I cannot reproduce the error anymore, I'm sorry for the noise.

These are the steps I used for Linux Mint 19.1 Tessa:

virtualenv env -p python3.6
source env/bin/activate
pip install aiohttp jupyter jupyter-plotly-dash

The status of Jupyter server extensions:

!jupyter serverextension list

config dir: /home/marco/env/etc/jupyter
    jupyter_plotly_dash.serverext  enabled 
    - Validating...
      jupyter_plotly_dash.serverext  OK
    nbserverproxy  enabled 
    - Validating...
      nbserverproxy  OK
HungYuHeng commented 5 years ago

Hi, I have the same problem,but my OS is windows10. When I run the code on https://github.com/GibbsConsulting/jupyter-plotly-dash I got the 404 error in jupyter notebook. And this is the error msg print on console: 302 GET /app/endpoints/d9f07d20a41b42ab84b46eb9771acb0f/ (::1) 0.00ms 404 GET /app/endpoints/d9f07d20a41b42ab84b46eb9771acb0f (::1) 2.00ms Please help me deal with this problem, thanks.

GibbsConsulting commented 5 years ago

@HunGYuHeng what does !jupyter serverextension list return?

HungYuHeng commented 5 years ago

@GibbsConsulting !jupyter serverextension list gives me : config dir: C:\Users\j5464\.jupyter jupyter_server_proxy enabled - Validating... jupyter_server_proxy ok

GibbsConsulting commented 5 years ago

I just tried the following steps in an empty temporary directory

virtualenv env -p python3.6
source env/bin/activate
pip install jupyter-plotly-dash
jupyter serverextension list

and the response I get is:

config dir: (my temporary directory full path)/env/etc/jupyter
    jupyter_plotly_dash.serverext  enabled 
    - Validating...
      jupyter_plotly_dash.serverext  OK
    nbserverproxy  enabled 
    - Validating...
      nbserverproxy  OK

which is essentially the same as @mpbrigham reported above when they had a successful install.

@HunGYuHeng are you taking these same steps, or their equivalent on windows? If so, you need to check to make sure each step is successful.

HungYuHeng commented 5 years ago

I know where the problem is. This file activate cannot be executed. But after doing this: Set-ExecutionPolicy RemoteSigned,and I solved this problem. Thanks you so much!

drahnreb commented 5 years ago

@HunGYuHeng are you taking these same steps, or their equivalent on windows? If so, you need to check to make sure each step is successful.

I get the same error within a conda virtual environment. Are those not supported?

jupyter serverextension list

`config dir: C:\Users....conda\envs\test\etc\jupyter jupyter_server_proxy enabled jupyterlab enabled jupyter_nbextensions_configurator enabled config dir: C:\ProgramData\jupyter jupyter_nbextensions_configurator enabled

GibbsConsulting commented 5 years ago

@drahnreb as already discussed in this thread, you need to make sure that the Windows equivalent of each step in the installer has been successfully performed. This is probably best done in a separate (conda equivalent of a) virtualenv to other packages, at least in the first instance.

mhammo30 commented 5 years ago

I was getting the same error running Ubuntu 18 in Windows Subsystem for Linux 2. I had to configure the jupyter c.NotebookApp.ip setting so I could access the notebooks from windows and had it set to c.NotebookApp.ip = '0.0.0.0'. I could reach the notebook but dash would 404.

I changed the c.NotebookApp.ip to match the connection IP for WSL and that seems to have fixed the problem. Hope this helps.

tony-bony commented 4 years ago

I just installed jupyter-plotly-dash by running sudo pip3 install jupyter-plotly-dash and I had the same issue:

Screenshot 2019-11-18 at 18 09 34

It turned out that jupyter_server_proxy was not installed so I tried:

sudo pip3 install jupyter_server_proxy
jupyter serverextension enable jupyter_server_proxy

Output:

Enabling: jupyter_server_proxy
- Writing config: /Users/<username>/.jupyter
    - Validating...
      jupyter_server_proxy  OK

I also did: sudo pip3 install jupyterlab sudo pip3 install jupyter_nbextensions_configurator jupyter serverextension enable jupyter_nbextensions_configurator jupyter nbextensions_configurator enable --user

There after: jupyter serverextension list

Output:

config dir: /Users/username/.jupyter
    jupyter_server_proxy  enabled 
    - Validating...
      jupyter_server_proxy  OK
    jupyter_nbextensions_configurator  enabled 
    - Validating...
      jupyter_nbextensions_configurator 0.4.1 OK
    jupyterlab  enabled 
    - Validating...
      jupyterlab 1.2.3 OK
config dir: /usr/local/etc/jupyter
    jupyterlab  enabled 
    - Validating...
      jupyterlab 1.2.3 OK

But nothing helps...

Error in Terminal:

[I 22:50:30.275 NotebookApp] Saving file at /Untitled2.ipynb
[I 22:51:13.913 NotebookApp] Starting buffering for cb6799e3-3cda-4fac-bacd-1aaa8b1349f4:6712c5fdb92347c78436d5b64025e89d
[I 22:51:14.182 NotebookApp] 302 GET /app/endpoints/ee72c92921c84645a2a236aa95e074d3/ (::1) 0.64ms
[W 22:51:14.187 NotebookApp] 404 GET /app/endpoints/ee72c92921c84645a2a236aa95e074d3 (::1) 1.83ms referer=http://localhost:8888/notebooks/Untitled2.ipynb?kernel_name=9f7b57aa-2a0e-4de6-a102-6e94b6818d63/channels?session_id=da5d16687a764e3aa20d14eee376f130

Does anybody have an idea how I can solve this problem?

delsim commented 4 years ago

Can you try installing it in a clean virtualenv? If it then doesn't work, use pip freeze to report your environment.

It is quite possible that trying to use the system python, which is not good practice and certainly not recommended, introduces issues of its own.

tony-bony commented 4 years ago

I see. I was indeed using the system Python3. Now after system-uninstalling and reinstalling jupyter-plotly-dash in a new virtualenv I am getting this error when running!jupyter serverextension list:

Enabling: jupyter_server_proxy
- Writing config: /Users/Andre/.jupyter
    - Validating...
Error loading server extension jupyter_server_proxy
      X is jupyter_server_proxy importable?

!pip freeze gives:

Package                           Version    
--------------------------------- -----------
-upyter-nbextensions-configurator 0.4.1      
aiohttp                           3.6.2      
appnope                           0.1.0      
async-timeout                     3.0.1      
attrs                             19.1.0     
autopep8                          1.4.4      
backcall                          0.1.0      
bleach                            3.1.0      
bokeh                             1.3.0      
certifi                           2019.6.16  
chardet                           3.0.4      
Click                             7.0        
click-plugins                     1.1.1      
cligj                             0.5.0      
cssselect                         1.0.3      
dash                              1.6.0      
dash-bootstrap-components         0.7.2      
dash-core-components              1.5.0      
dash-daq                          0.3.0      
dash-html-components              1.0.1      
dash-renderer                     1.2.0      
dash-table                        4.5.0      
decorator                         4.4.1      
defusedxml                        0.6.0      
Django                            2.2.7      
django-plotly-dash                1.1.0      
dpd-components                    0.1.0      
entrypoints                       0.3        
et-xmlfile                        1.0.1      
Fiona                             1.8.6      
Flask                             1.1.1      
Flask-Compress                    1.4.0      
future                            0.18.2     
generateDS                        2.33.1     
geopandas                         0.5.1      
html5lib                          1.0.1      
idna                              2.8        
importlib-metadata                0.23       
ipykernel                         5.1.3      
ipython                           7.9.0      
ipython-genutils                  0.2.0      
ipywidgets                        7.5.1      
itsdangerous                      1.1.0      
jdcal                             1.4.1      
jedi                              0.15.1     
Jinja2                            2.10.1     
json5                             0.8.5      
jsonschema                        3.1.1      
jupyter                           1.0.0      
jupyter-client                    5.3.4      
jupyter-console                   6.0.0      
jupyter-contrib-core              0.3.3      
jupyter-core                      4.6.1      
jupyter-nbextensions-configurator 0.4.1      
jupyter-plotly-dash               0.3.1      
jupyter-server-proxy              1.2.0      
jupyterlab                        1.2.3      
jupyterlab-server                 1.0.6      
lxml                              4.4.0      
MarkupSafe                        1.1.1      
meson                             0.49.2     
mistune                           0.8.4      
more-itertools                    7.2.0      
multidict                         4.5.2      
munch                             2.3.2      
nbconvert                         5.6.1      
nbformat                          4.4.0      
nbserverproxy                     0.8.8      
notebook                          6.0.2      
numpy                             1.17.0     
openpyxl                          2.6.2      
ordered-set                       3.1.1      
packaging                         19.0       
pandas                            0.25.0     
pandas-datareader                 0.8.1      
pandocfilters                     1.4.2      
parso                             0.5.1      
pbr                               5.4.3      
pexpect                           4.7.0      
pickleshare                       0.7.5      
Pillow                            6.1.0      
pip                               19.3.1     
plotly                            4.2.1      
prometheus-client                 0.7.1      
prompt-toolkit                    2.0.10     
ptyprocess                        0.6.0      
pycodestyle                       2.5.0      
pycurl                            7.43.0.3   
pyecore                           0.10.3     
pyecoregen                        0.4.3      
Pygments                          2.4.2      
pymultigen                        0.2.0      
pyparsing                         2.4.1.1    
pyproj                            2.2.1      
pyquery                           1.4.0      
pyrsistent                        0.15.5     
python-dateutil                   2.8.0      
pytz                              2019.1     
PyYAML                            5.1.1      
pyzmq                             18.1.1     
qtconsole                         4.5.5      
requests                          2.22.0     
RestrictedPython                  4.0        
retrying                          1.3.3      
selenium                          3.141.0    
Send2Trash                        1.5.0      
setuptools                        40.8.0     
Shapely                           1.6.4.post2
simpervisor                       0.3        
six                               1.12.0     
splinter                          0.11.0     
sqlparse                          0.3.0      
stevedore                         1.31.0     
terminado                         0.8.3      
testpath                          0.4.4      
tornado                           6.0.3      
traitlets                         4.3.3      
urllib3                           1.25.3     
virtualenv                        16.7.7     
virtualenv-clone                  0.5.3      
virtualenvwrapper                 4.8.4      
wcwidth                           0.1.7      
webencodings                      0.5.1      
Werkzeug                          0.16.0     
wheel                             0.33.0     
widgetsnbextension                3.5.1      
xlrd                              1.2.0      
yarl                              1.3.0      
zipp                              0.6.0  

Any clue how to proceed?

fkromer commented 4 years ago

I've the same issue.

delsim commented 4 years ago

So I just tried the following on a Linux Mint 18.3 machine in an empty directory:

virtualenv env -p python3.6
source env/bin/activate
pip install jupyter-plotly-dash

At this point, the command jupyter serverextension list returns:

(env) prompt_here $ jupyter serverextension list
config dir: [...this directory...]/env/etc/jupyter
    jupyter_plotly_dash.serverext  enabled 
    - Validating...
      jupyter_plotly_dash.serverext  OK
    nbserverproxy  enabled 
    - Validating...
      nbserverproxy  OK

and running jupyter notebook allows me to create a notebook with multiple fully functional JupyterDash instances.

Running pip freeze includes the following lines:

dash==1.6.1
dash-core-components==1.5.1
dash-html-components==1.0.2
dash-renderer==1.2.1
dash-table==4.5.1
Django==2.2.7
django-plotly-dash==1.1.1
dpd-components==0.1.0
ipykernel==5.1.3
ipython==7.9.0
ipython-genutils==0.2.0
ipywidgets==7.5.1
jupyter==1.0.0
jupyter-client==5.3.4
jupyter-console==6.0.0
jupyter-core==4.6.1
jupyter-plotly-dash==0.3.1
nbconvert==5.6.1
nbformat==4.4.0
nbserverproxy==0.8.8
tornado==6.0.3

Adding in pip install jupyterlab and launching with jupyter lab allows me to open and run the notebook inside JupyterLab where it remains fully functional.

For the additional packages, pip freeze reports

jupyterlab==1.2.3
jupyterlab-server==1.0.6

with the other packages unchanged. Notably juypter-server-proxy remains absent from the extension list:

(env) [prompt here] $ jupyter serverextension list
config dir: [the local directory used for this exercise]/env/etc/jupyter
    jupyter_plotly_dash.serverext  enabled 
    - Validating...
      jupyter_plotly_dash.serverext  OK
    nbserverproxy  enabled 
    - Validating...
      nbserverproxy  OK
    jupyterlab  enabled 
    - Validating...
      jupyterlab 1.2.3 OK

Now, adding pip install jupyter-server-proxy adds the package but does not remove nbserverproxy and everything continues to work, and this is also the case if I now execute pip uninstall nbserverproxy.

I think to track this issue down, more clarity is needed on (a) the installation steps being followed and (b) what happens after each step, for an unsuccessful installation. It is also important to perform this exercise in a virtualenv to make it easier to understand what is installed and also to prevent anything from the external environment from interfering.

tonydeck0506 commented 4 years ago

I installed 0.4.0 version with a success on my Mac Os in the docker container. how ever the 404 error happened when running the sample code in the github. (https://github.com/GibbsConsulting/jupyter-plotly-dash)

  1. I run the !jupyter serverextension list [output] config dir: /usr/local/etc/jupyter jupyter_plotly_dash.serverext enabled
    • Validating... jupyter_plotly_dash.serverext OK nbserverproxy enabled
    • Validating... nbserverproxy OK

seems correct.

  1. I run !pip freeze [output] absl-py==0.7.1 aiohttp==3.6.2 asgiref==3.2.3 astor==0.8.0 async-timeout==3.0.1 atomicwrites==1.3.0 attrs==19.1.0 audioread==2.1.8 backcall==0.1.0 bleach==3.1.0 cachetools==3.1.1 certifi==2019.6.16 chardet==3.0.4 chart-studio==1.0.0 Click==7.0 coverage==4.5.4 cycler==0.10.0 dash==1.1.1 dash-core-components==1.1.1 dash-html-components==1.0.0 dash-renderer==1.0.0 dash-table==4.1.0 decorator==4.4.0 defusedxml==0.6.0 Django==3.0.3 django-plotly-dash==1.1.5 dpd-components==0.1.0 entrypoints==0.3 Flask==1.1.1 Flask-Caching==1.7.2 Flask-Compress==1.4.0 gast==0.2.2 google-api-python-client==1.7.10 google-auth==1.6.3 google-auth-httplib2==0.0.3 google-pasta==0.1.7 grpcio==1.23.0 gunicorn==19.9.0 h5py==2.9.0 httplib2==0.13.1 idna==2.8 idna-ssl==1.1.0 importlib-metadata==0.19 ipykernel==5.1.1 ipython==7.7.0 ipython-genutils==0.2.0 ipywidgets==7.5.1 itsdangerous==1.1.0 jedi==0.15.1 Jinja2==2.10.1 joblib==0.13.2 jsonschema==3.0.2 jupyter==1.0.0 jupyter-client==5.3.1 jupyter-console==6.0.0 jupyter-core==4.5.0 jupyter-plotly-dash==0.4.0 Keras==2.2.4 Keras-Applications==1.0.8 Keras-Preprocessing==1.1.0 kiwisolver==1.1.0 librosa==0.6.3 llvmlite==0.29.0 Markdown==3.1.1 MarkupSafe==1.1.1 matplotlib==3.1.1 mecab-python3==0.996.2 mistune==0.8.4 more-itertools==7.2.0 mpmath==1.1.0 multidict==4.7.4 nbconvert==5.6.0 nbformat==4.4.0 nbserverproxy==0.8.8 notebook==6.0.0 numba==0.45.1 numpy==1.16.3 packaging==19.1 pandas==0.24.2 pandocfilters==1.4.2 parso==0.5.1 patsy==0.5.1 pexpect==4.7.0 pickleshare==0.7.5 Pillow==6.1.0 plotly==4.1.0 plotly-express==0.4.1 pluggy==0.12.0 prometheus-client==0.7.1 prompt-toolkit==2.0.9 protobuf==3.9.1 ptyprocess==0.6.0 py==1.8.0 pyasn1==0.4.6 pyasn1-modules==0.2.6 Pygments==2.4.2 pyparsing==2.4.2 pyrsistent==0.15.4 pytest==5.0.1 python-dateutil==2.8.0 pytz==2019.2 PyYAML==5.1.2 pyzmq==18.1.0 qtconsole==4.5.3 redis==3.3.0 requests==2.22.0 resampy==0.2.2 retrying==1.3.3 rsa==4.0 scikit-learn==0.21.2 scipy==1.3.0 seaborn==0.9.0 Send2Trash==1.5.0 simpy==3.0.11 six==1.12.0 sqlparse==0.3.0 statsmodels==0.10.1 sympy==1.4 tensorboard==1.14.0 tensorflow==1.14.0 tensorflow-estimator==1.14.0 termcolor==1.1.0 terminado==0.8.2 testpath==0.4.2 tornado==5.1.1 traitlets==4.3.2 typing-extensions==3.7.4.1 uritemplate==3.0.0 urllib3==1.25.3 wcwidth==0.1.7 webencodings==0.5.1 Werkzeug==0.15.5 widgetsnbextension==3.5.1 wrapt==1.11.2 yarl==1.4.2 zipp==0.5.2

anyone can give me some clue? thanks in advance.

GibbsConsulting commented 4 years ago

@tonydeck0506 v0.4.0 had a dependencies issue; are you in a position to try after forcing an upgrade to 0.4.2 or newer? Something like pip install -U jupyter-plotly-dash should suffice.

tonydeck0506 commented 4 years ago

@GibbsConsulting I've updated to v.0.4.2 . the same error message is displayed. ("404 not found...")

  1. the result of !jupyter serverextension list [output] config dir: /usr/local/etc/jupyter jupyter_plotly_dash.serverext enabled Validating... jupyter_plotly_dash.serverext OK nbserverproxy enabled Validating... nbserverproxy OK

  2. !pip freeze result absl-py==0.7.1 aiohttp==3.6.2 asgiref==3.2.3 astor==0.8.0 async-timeout==3.0.1 atomicwrites==1.3.0 attrs==19.1.0 audioread==2.1.8 backcall==0.1.0 beautifulsoup4==4.8.2 bleach==3.1.0 cachetools==3.1.1 certifi==2019.6.16 chardet==3.0.4 chart-studio==1.0.0 Click==7.0 coverage==4.5.4 cycler==0.10.0 dash==1.1.1 dash-core-components==1.1.1 dash-html-components==1.0.0 dash-renderer==1.0.0 dash-table==4.1.0 decorator==4.4.0 defusedxml==0.6.0 Django==3.0.3 django-bootstrap4==1.1.1 django-plotly-dash==1.1.5 dpd-components==0.1.0 dpd-static-support==0.0.5 entrypoints==0.3 Flask==1.1.1 Flask-Caching==1.7.2 Flask-Compress==1.4.0 gast==0.2.2 google-api-python-client==1.7.10 google-auth==1.6.3 google-auth-httplib2==0.0.3 google-pasta==0.1.7 grpcio==1.23.0 gunicorn==19.9.0 h5py==2.9.0 httplib2==0.13.1 idna==2.8 idna-ssl==1.1.0 importlib-metadata==0.19 ipykernel==5.1.1 ipython==7.7.0 ipython-genutils==0.2.0 ipywidgets==7.5.1 itsdangerous==1.1.0 jedi==0.15.1 Jinja2==2.10.1 joblib==0.13.2 jsonschema==3.0.2 jupyter==1.0.0 jupyter-client==5.3.1 jupyter-console==6.0.0 jupyter-core==4.5.0 jupyter-plotly-dash==0.4.2 Keras==2.2.4 Keras-Applications==1.0.8 Keras-Preprocessing==1.1.0 kiwisolver==1.1.0 librosa==0.6.3 llvmlite==0.29.0 Markdown==3.1.1 MarkupSafe==1.1.1 matplotlib==3.1.1 mecab-python3==0.996.2 mistune==0.8.4 more-itertools==7.2.0 mpmath==1.1.0 multidict==4.7.4 nbconvert==5.6.0 nbformat==4.4.0 nbserverproxy==0.8.8 notebook==6.0.0 numba==0.45.1 numpy==1.16.3 packaging==19.1 pandas==0.24.2 pandocfilters==1.4.2 parso==0.5.1 patsy==0.5.1 pexpect==4.7.0 pickleshare==0.7.5 Pillow==6.1.0 plotly==4.1.0 plotly-express==0.4.1 pluggy==0.12.0 prometheus-client==0.7.1 prompt-toolkit==2.0.9 protobuf==3.9.1 ptyprocess==0.6.0 py==1.8.0 pyasn1==0.4.6 pyasn1-modules==0.2.6 Pygments==2.4.2 pyparsing==2.4.2 pyrsistent==0.15.4 pytest==5.0.1 python-dateutil==2.8.0 pytz==2019.2 PyYAML==5.1.2 pyzmq==18.1.0 qtconsole==4.5.3 redis==3.3.0 requests==2.22.0 resampy==0.2.2 retrying==1.3.3 rsa==4.0 scikit-learn==0.21.2 scipy==1.3.0 seaborn==0.9.0 Send2Trash==1.5.0 simpy==3.0.11 six==1.12.0 soupsieve==1.9.5 sqlparse==0.3.0 statsmodels==0.10.1 sympy==1.4 tensorboard==1.14.0 tensorflow==1.14.0 tensorflow-estimator==1.14.0 termcolor==1.1.0 terminado==0.8.2 testpath==0.4.2 tornado==5.1.1 traitlets==4.3.2 typing-extensions==3.7.4.1 uritemplate==3.0.0 urllib3==1.25.3 wcwidth==0.1.7 webencodings==0.5.1 Werkzeug==0.15.5 widgetsnbextension==3.5.1 wrapt==1.11.2 yarl==1.4.2 zipp==0.5.2

  3. the jupyter environment is in docker container(Linux Ubuntu). the configure file relevant to Jupyter in Dockerfile.

Set up Jupyter Notebook config

ENV CONFIG /root/.jupyter/jupyter_notebook_config.py ENV CONFIG_IPYTHON /root/.ipython/profile_default/ipython_config.py

RUN jupyter notebook --generate-config --allow-root && \ ipython profile create

RUN echo "c.NotebookApp.ip = '0.0.0.0'" >>${CONFIG} && \ echo "c.NotebookApp.port = 8888" >>${CONFIG} && \ echo "c.NotebookApp.open_browser = False" >>${CONFIG} && \ echo "c.NotebookApp.iopub_data_rate_limit=10000000000" >>${CONFIG} && \ echo "c.NotebookApp.token = ''" >>${CONFIG} && \ echo "c.MultiKernelManager.default_kernel_name = 'python3'" >>${CONFIG}

RUN echo "c.InteractiveShellApp.exec_lines = ['%matplotlib inline']" >>${CON FIG_IPYTHON}

I saw previous message from "mhammo30 commented on Aug 2, 2019" said that c.NotebookApp.ip needs to be set as a fixed ip. but I have to put the ip to 0.0.0.0. does this stuff cause the problem of "404 error"? thanks in advance. Tony

mhammo30 commented 4 years ago

@tonydeck0506 here is the code I added to my jupyter_notebook_config.py that resolved the WSL's IP address at notebook startup.

import netifaces as ni
ip = ni.ifaddresses('eth0')[ni.AF_INET][0]['addr']
c.NotebookApp.ip = str(ip)

For jupyter in WSL it binds so an IP like '172.17.0.3' which my host windows machine could connect to and have jupyter-plotly-dash not throw the 404 error. You may need to change the ifaddresses('<interface>') for docker as it may spawn with a different name.

Hope this helps.

tonydeck0506 commented 4 years ago

@johnwallaceEmr thanks for your feedback. however.

  1. the docker is on Mac OS system
  2. I did not use WSL. I only web browser to connect the docker/jupyter through windows or mac os.
  3. I need to use "0.0.0.0" configure to have a few people to connect the docker. any way out under this constraint? thanks tony
tonydeck0506 commented 4 years ago

assume WSL = windows sub-system for linux

mhammo30 commented 4 years ago

@tonydeck0506 I spun up a quick docker container serving jupyter and testing the same script that was giving me problems with my original post using this DockerFile.

FROM python:3.6.8-slim-stretch

ENV CONFIG /root/.jupyter/jupyter_notebook_config.py
ENV CFG_PY /root/.ipython/profile_default/ipython_config.py

WORKDIR /testcontent
COPY . /testcontent

RUN \
    apt-get update \
    && apt-get install -y \
        python3-dev curl apt-transport-https build-essential gnupg2 jupyter-notebook \
    && pip3 install wheel \
    && pip3 install jupyter-plotly-dash requests netifaces pandas numpy voluptuous dash plotly \
    && jupyter notebook --generate-config --allow-root \
    && ipython profile create \
    && echo "import netifaces as ni\nip=ni.ifaddresses('eth0')[ni.AF_INET][0]['addr']\nc.NotebookApp.ip=str(ip)" >> ${CONFIG} \
    && echo "c.NotebookApp.port = 8888" >> ${CONFIG} \
    && echo "c.NotebookApp.open_browser = False" >> ${CONFIG} \
    && echo "c.NotebookApp.iopub_data_rate_limit = 1_000_000_000" >> ${CONFIG} \
    && echo "c.NotebookApp.token =''" >> ${CONFIG} \
    && echo "c.MultiKernelManager.default_kernel_name = 'python3'" >> ${CONFIG} \
    && echo "c.InteractiveShellApp.exec_lines = ['%matplotlib inline']" >> ${CFG_PY}

EXPOSE 8888
ENTRYPOINT [ "/bin/sh", "jupyter", "notebook", "--allow-root" ]

I used this cmd to start the container (had to retarget the entrypoint as i forgot some pip installs)

docker run --rm --name=jupyter_test -it -p "8888:8888" --entrypoint "/bin/sh" testjupyter:latest

I was able to connect to jupyter using the docker containers IP '172.17.0.2' and localhost from a host linux vm.

the '0.0.0.0' ip is for jupyter to listen to if you want other apps/services inside the container to connect to jupyter without knowing it's bind address. For connections outside the container that target the host system IP and the jupyter port, docker will do the routing into the container without a problem.

See if this works for you.

tonydeck0506 commented 4 years ago

@mhammo30 thanks for your reply. I tried with the solution. It seems that the "404 error" still displayed when I ran the default sample program... so it might not be the "0.0.0.0" cause the problem. my docker container is on the docker of MacOS. thanks. Tony

xyz8983 commented 4 years ago

I get the same issues. After create the virtual environment, install and enable the jupyter_server_proxy, it still not work for me. Then I realize that I open my jupyter notebook from global python and select the special kernel that i created from the virtual env. I SHOULD open the jupyter notebook from the virtual env, not from the global python (even select the special kernel using the venv wont work). Hope this helps.

MingBit commented 3 years ago

I get the same issues. After create the virtual environment, install and enable the jupyter_server_proxy, it still not work for me. Then I realize that I open my jupyter notebook from global python and select the special kernel that i created from the virtual env. I SHOULD open the jupyter notebook from the virtual env, not from the global python (even select the special kernel using the venv wont work). Hope this helps.

i also tried to install jupyter-plotly_dash in the conda environment and run the code in the jupyter notebook from this env.. Unfortunately it didn't work either ...