Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

Plots not working with Jupyter lab #17

Closed
shakasom opened this issue Mar 21, 2019 · 15 comments
Closed

Plots not working with Jupyter lab #17

shakasom opened this issue Mar 21, 2019 · 15 comments

Comments

@shakasom
Copy link

Unless i use offline mode explicitly, plots will not show up in Jupyter lab. But works fine with Jupyter notebook

@nicolaskruchten
Copy link
Contributor

OK, I'll give this a whirl tomorrow! What versions of Python and JupyterLab are you using?

Also, what do you mean by "Unless i use offline mode explicitly" ?

@CloudChaoszero
Copy link

@shakasom , hope this helps!


Run this in your jupyter notebook, or jupyterlab env, cell:

!pip install plotly_express

I posted reasons and such here:

#11 (comment)

@shakasom
Copy link
Author

I just meant initializing for offline plotting ... Plotly.offline.plot. In that case if i pass it to plotly_express object it will work.

@shakasom
Copy link
Author

Windows 10: Jupyterlab 0.35.3 and Python 3.6.6.
Ubuntu 18.04: Jupyter lab 0.35.4 and Python 3.7.2

@jonmmease
Copy link
Contributor

Hi @shakasom ,

Rendering figures in JupyterLab using plotly.offline.iplot requires the @jupyterlab/plotly-extension extension. If you don't have this installed, give that a try and see if that helps.

@shakasom
Copy link
Author

Thanks @jonmmease . That fixed the issue.

@DmitriyG228
Copy link

HI, I have tried everything I could find over the internet to resolve this issue, but px still plots empty.

@nicolaskruchten
Copy link
Contributor

@DmitriyG228 can you tell me which command you're using to launch the Notebook, and which versions of Jupyter, the Jupyter extension, and Plotly and Plotly Express you are using?

When using jupyter notebook it sometimes happens that the notebook loses track of its state, in which case you unfortunately need to use the "restart & clear output" option from the Kernel menu in the notebook. JupyterLab doesn't suffer from this problem.

@DmitriyG228
Copy link

Hi, @nicolaskruchten ,

  • My lab is running on remote server (Ubuntu 18.04.3),

  • I launch server with /bin/bash -c "cd /path; source ~/.bashrc; conda activate base; (jupyter lab --ip=0.0.0.0 --port=9996 >> /var/log/jupyter2.log 2>>/var/log/jupyter2.log)" &

  • i connect to jupyter server with dedicated domain name.

  • jupyter lab version 0.35.4

  • I am not very familiar with jupyterlab extensions and can not find how to check what is installed, but, I remember that I have installed @jupyterlab/plotly-extension and some other one.

plotly==4.0.0
plotly-express==0.4.0

Thank you!

@nicolaskruchten
Copy link
Contributor

@DmitriyG228 ok thanks! I will definitely need the list of lab extensions, available by running jupyter labextension list... I suspect you have the old, pre-v4-compatible extension.

@DmitriyG228
Copy link

@nicolaskruchten , thank you and sorry for my noob knowledge of extensions

(fastai) dima@ml:~$ jupyter labextension list
JupyterLab v1.1.4
Known labextensions:
   app dir: /home/dima/anaconda3/envs/fastai/share/jupyter/lab
        @jupyterlab/plotly-extension v1.0.0  enabled  OK
        nbdime-jupyterlab v1.0.0  enabled  OK
        plotlywidget v0.8.0  enabled  OK

Build recommended, please run `jupyter lab build`:
    plotlywidget needs to be included in build
(fastai) dima@ml:~$ jupyter lab build
[LabBuildApp] JupyterLab 1.1.4
[LabBuildApp] Building in /home/dima/anaconda3/envs/fastai/share/jupyter/lab
[LabBuildApp] Building jupyterlab assets (build:prod:minimize)
An error occured.
RuntimeError: JupyterLab failed to build

@DmitriyG228
Copy link

@nicolaskruchten, can you please look at my issue once again? you may have missed my last message. thank you!

@nicolaskruchten
Copy link
Contributor

Sorry, yes. The output above suggests that the extensions aren't installing correctly, but I'm not sure why. I would recommend uninstalling and reinstalling the latest version of the extensions (which are 1.2.0 I think, today!)

@rlele5
Copy link

rlele5 commented Mar 28, 2020

Don't know what the status of this is, but plotly plots still don't plot for me in Jupyter Lab.

@nicolaskruchten
Copy link
Contributor

If you're encountering rendering issues, please check out our troubleshooting guide at https://plotly.com/python/troubleshooting/ and if there are no answers there for you, please create a new issue in the Plotly.py repo and we will try to help you :)

@plotly plotly locked and limited conversation to collaborators Mar 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants