What is Right extension for Plotly in JupyterLab? - python

Plotly is not working in Jupyterlab. I assume that there is a conflict in required extensions but I'm not sure.
On checking troubleshooting on Plotly https://plotly.com/python/troubleshooting/ , they advise to remove extensions and install them again.
But I found that there is additional extension that came with Jupyterlab update called 'jupyterlab-plotly-extension'
which is not mentioned by Plotly in their instructions to make it working in JupyterLab https://plotly.com/python/getting-started/#jupyterlab-support-python-35
My question is: which extensions should be installed to make Plotly working in JupyterLab?
jupyterlab-plotly as mentioned in Plotly support
jupyterlab-plotly-extension that came with JupyterLab

You can install plotly using pip or conda:
pip install "plotly>=5" "ipywidgets>=7.6"
# or if using conda
# conda install -c plotly "plotly>=5"
# conda install "ipywidgets>=7.6"
Plotly comes with support for both the Jupyter Notebook and JupyterLab. There is no need to install anything else for JupyterLab 3.0 and newer. The widget package and the renderer package are both included in plotly starting from v5.
For older versions of JupyterLab (1.x and 2.x) you will need a recent Node.js installed and install additional packages; do not run these commands if using newer version of JupyterLab:
pip install "ipywidgets>=7.5"
# renderer support
jupyter labextension install jupyterlab-plotly
# OPTIONAL: Jupyter widgets extension
jupyter labextension install #jupyter-widgets/jupyterlab-manager plotlywidget

Enter 'jupyter labextension list' in a terminal or command to run the environment status. The example below shows my environment information with 'jupyter lab' running successfully.
xxxxx-no-iMac:~ xxxxx$ jupyter labextension list
JupyterLab v2.1.5
Known labextensions:
app dir: /Library/Frameworks/Python.framework/Versions/3.6/share/jupyter/lab
#jupyter-widgets/jupyterlab-manager v2.0.0 enabled OK
#jupyterlab/git v0.20.0 enabled OK
#lckr/jupyterlab_variableinspector v0.5.0 enabled OK
jupyterlab-plotly v1.5.4 enabled OK
nbdime-jupyterlab v2.0.0 enabled OK
plotlywidget v1.5.4 enabled OK

Assuming that you have installed all the libraries correctly (make sure you have ipywidgets and nodejs installed) and assuming one is using conda, access conda prompt for the environment one is working (the "Server" environment).
Then, you will need to install the extension(s) jupyterlab-plotly (the library nodejs will be required now)
jupyter labextension install jupyterlab-plotly#4.14.3
and plotlywidget [optional] - this one requires nodejs >=10.0.0
jupyter labextension install #jupyter-widgets/jupyterlab-manager plotlywidget#4.14.1
For a more detailed explanation, you may want to read my answer here.

upyterLab Support (Python 3.5+)
For use in JupyterLab, install the jupyterlab and ipywidgets packages using pip...
$ pip install jupyterlab "ipywidgets>=7.5"
or conda.
$ conda install jupyterlab "ipywidgets=7.5"
Then run the following commands to install the required JupyterLab extensions (note that this will require node to be installed):
JupyterLab renderer support
jupyter labextension install jupyterlab-plotly#4.12.0
OPTIONAL: Jupyter widgets extension
jupyter labextension install #jupyter-widgets/jupyterlab-manager plotlywidget#4.12.0
Refer:
https://plotly.com/python/getting-started/#jupyterlab-support-python-35

Related

Jupyter Lab - Kite is installed but its not working

i've been trying to install Kite in JupyterLab v2.2.6. I have dowloaded and installed Kite, have node.js 15.0.1 and i've run the console commands:
pip install jupyter-kite
jupyter labextension install "#kiteco/jupyterlab-kite"
i have no problems with either and when i check in jupyter extension manager it tells me that it is installed
Kite missing some dependencies error message in jupyterlab
Update for macOS Catalina users, try upgrading JupyterLab > 2.2.9:
Open Terminal:
$ conda install -c conda-forge jupyterlab=3.0.3
Open Kite copilot:
-->
Home
-->
Redo Setup
Open Terminal:
$ pip install "jupyterlab-kite>=2.0.2"
As of this post, Kite works with:
jupyterlab 3.2.7
jupyterlab-kite 2.0.2
JupyterLab:
conda install -c conda-forge jupyterlab=3.2.7
or
pip install jupyterlab==3.2.7
Kite:
pip install jupyterlab-kite>=2.0.2 (only PyPI)
jupyter labextension install "#kiteco/jupyterlab-kite"
Note also that as of this post, there is no Kite extension for VS Code that is compatible with .ipynb. The VS Code Kite extension is compatible with .py .go .js .jsx .vue only.
In addition, you can no longer download the Kite engine from the Kite website.
Adam has posted the installers here.
macOS
Windows
Linux
I had the same problem and for me the following worked:
Reinstalled Anaconda and then I updated the provided JupyterLab version in the (base) terminal. (You would like to update your JupyterLab in the respective virtual environment you are using Anaconda with.)
conda install -c conda-forge jupyterlab==2.2.9
The JupyterLab version in your Anaconda should show 2.2.9 after you restart Anaconda. After this, download node.js and install it on you computer. Then follow the instructions in your Kite desktop app to install the Jupyter Kite extension via the (base) terminal:
pip install jupyter-kite
jupyter labextension install "#kiteco/jupyterlab-kite"
Open your Kite desktop app and click on Redo Setup under the Home section.
In your JupyterLab Kite: Initializing should appear down in the left corner.

How to handle 'Widget Loading...' Message in Google Cloud's JupyterLab AI Platform?

I am working on getting to know FairLearn in Google Cloud's AI Platform (via JupyterLab). For now, I am starting with the tutorial and when I run the code for the Fairlearn Dashboard, I get an indefinite 'Loading widget...' as seen below.
I have been reading on other threads of users struggling with Wit-widget in JupyterLab to no avail.
Within my terminal in JupyterLab (within my conda environment), I did the following installations successfully:
> pip install ipywidgets
> jupyter nbextension enable --py widgetsnbextension
> conda install -c conda-forge nodejs
> jupyter nbextension install --py --user witwidget
> jupyter nbextension enable witwidget --user --py
And within my jupyter notebook, I also include:
!jupyter labextension install #jupyter-widgets/jupyterlab-manager
I also have the following jupyterlab extension list:
JupyterLab is not yet supported, see https://github.com/fairlearn/fairlearn/issues/484#issuecomment-651095161 for reference.
You should be able to run this in Jupyter (not Jupyter Lab) directly, though.

Unable to Install Pandas-profiling

I am trying to install Pandas-Profiling package for Jupyter Notebook but no luck!!!
Tried installing the package from the Anaconda Navigator (Home) -> Environment -> base(root) -> Search packages -> Pandas-profiling
A dialog box appears to show as "Solving Package modifications" but after some time, the dialog box appears blank!!!
Tried "Conda prompt" option also but it shows deprecated
Sometimes, it's a version issue.
Try this
!pip install -U pandas-profiling
Reference
Try
pip install https://github.com/pandas-profiling/pandas-profiling/archive/master.zip
Good luck!
Reference

jupyter notebook installation issue using pip

I had a problem with jupyter notebook. Every time I started a notebook, kernel died.
So, I decided to uninstall jupyter notebook using pip:
pip uninstall jupyter notebook
After successful uninstallation, I installed again, using same pip:
pip install jupyter notebook
Then, as usually, I typed in cmd:
jupyter notebook
But got this error:
'jupyter' is not recognized as an internal or external command,
operable program or batch file.
So I checked the location of IPython, and found out that now the right file, which I want to call is jupyter-notebook, which different from jupyter notebook by dash sign. If I run jupyter-notebook from cmd everything works.
Can anyone explain, what happened and why the file now called jupyter-notebook?
Thank You
Because pip uses the legacy Python 2.
Use pip3 to install:
pip3 install --upgrade pip
pip3 install jupyter
jupyter notebook #to start jupyter notebook
I highly recommend installing Anaconda.
Download Anaconda here.
Then use :
bash
to install it.
Good Luck.
A solution without installing Anaconda, or conda:
sudo easy_install pip==20.3.4
pip2 install virtualenv
virtualenv jupyter
source jupyter/bin/activate
pip2 install jupyter
jupyter notebook
This solution was tested on:
Distributor ID: Ubuntu
Description: Ubuntu 16.04.7 LTS
Release: 16.04
Codename: xenial
It was run on 32bit Chromenotebook, with Firefox vs NetSurf installed on xenial
Jupyter notebook will be open automatically. However, everytime loging in on Jupiter again, at first source needs to be activated:
source jupyter/bin/activate
and then:
jupyter notebook
to start
I recommend that you always use conda instead of pip to install the Jupyter Notebook.
In your case, for example, I will recommend:
conda install jupyter notebook
and not pip install jupyter notebook I can see that most of the problems that you described there are environment related and hence you can often run into environment issues while using pip to install jupyter

Jupyter: can't create new notebook?

I have some existing Python code that I want to convert to a Jupyter notebook. I have run:
jupyter notebook
Now I can see this in my browser:
But how do I create a new notebook? The Notebook link in the menu is greyed out, and I can't see any other options to create a new notebook.
I've noticed this on the command line while Jupyter is running:
[W 22:30:08.128 NotebookApp] Native kernel (python2) is not available
None of the other answers worked for me on Ubuntu 14.04. After 2 days of struggling, I finally realized that I needed to install the latest version of IPython (not the one in pip). First, I uninstalled ipython from my system with:
sudo apt-get --purge remove ipython
sudo pip uninstall ipython
I don't know if you need both, but both did something on my system.
Then, I installed ipython from source like this:
git clone https://github.com/ipython/ipython.git
cd ipython
sudo pip install -e .
Note the period at the end of the last line. After this, I reran jupyter notebook and the python2 kernel was detected!
It looks like you don't have an IPython kernel installed (or any other kernel for that matter!).
There are various ways (old versions, new versions) to do this. One of the simplest ways is to use pip. From the command line enter:
pip install ipython
You may also need to register the kernel with Jupyter (see the new versions page):
python -m pip install ipykernel
python -m ipykernel install [--user] [--name <machine-readable-name>] [--display-name <"User Friendly Name">]
You should now be able to launch a Python notebook from Jupyter.
Alternatively, installing Jupyter using any of the methods on this page should ensure that the IPython kernel is already there. Personally, Anaconda has always just worked out of the box for me (when I've used it on Linux and Mac OS).
I had similar issue but looks like this its because I was using python 2.7. I was able to launch notebook by clicking on "Python 2" dropdown option.
For me the error was:
ERROR: notebook 6.0.0 has requirement tornado>=5.0, but you'll have tornado 4.5.3 which is incompatible.
I solved it by following the below steps:
pip uninstall ipykernel
pip install --upgrade tornado
pip install ipykernel
Now open jupyter notebook from terminal. It should work fine.
I had the same problem, it is because I installed ipython with sudo apt-get -y install ipython ipython-notebook instead of sudo pip install ipython.
Therefore, uninstall all ipython stuff using:
sudo apt-get --purge remove ipython
sudo pip uninstall ipython
and then install it with pip
I was also getting the same error. My error snapshot is here. Following below solved my problem:
sudo apt-get -y install ipython ipython-notebook
sudo -H pip install jupyter
It was not working because I was getting 0 active kernel message and this came because I installed jupyter using step2 only (skipped step1).
If anyone is still having this issue, for me it was solved by running
pip install --upgrade ipykernel
because ipython version is too new.
you can use follow commands
pip uninstall ipython
pip install ipython==5.1
Also, check if you have cookies enabled in your browser. Without cookies, the listing of the directory appears empty, as does the notebook creation menu.

Categories