2

My jupyter lab is not showing any icons Here is how it's appearing enter image description here

This is when i run jupyter lab using these 2 commands

conda activate python_cvcourse
jupyter-lab

But if i use only

jupyter-lab

to launch the jupyter notebook (which does not create the environment i need) then here is how the notebook is showing enter image description here

You can see how all the icons are visible now, i don't understand what's the problem here i can work around this by remembering where the icons are but that is not very helpful, what should i do? I am on windows 10 and the jupyter versions i am using are

jupyter core     : 4.6.3
jupyter-notebook : 6.1.4
qtconsole        : 4.7.7
ipython          : 7.19.0
ipykernel        : 5.3.4
jupyter client   : 6.1.7
jupyter lab      : 2.2.6
nbconvert        : 6.0.7
ipywidgets       : 7.5.1
nbformat         : 5.0.8
traitlets        : 5.0.5
Saksham Jain
  • 57
  • 1
  • 6
  • See my answer below. I can tell you have two different versions by the different breadcrumbs indicators in the file browser. Please let me know if you had the other version installed via pip or conda and if this helped to solve the problem. – krassowski Apr 10 '21 at 15:34

2 Answers2

4

Do you have pyLDAvis installed in your virtual environment? Apparently there is a strong evidence that it is an interaction with pyLDAvis. You can check it here

To fix you can execute this in your notebook:

from IPython.display import HTML
css_str = '<style> \
.jp-Button path { fill: #616161;} \
text.terms { fill: #616161;} \
.jp-icon-warn0 path {fill: var(--jp-warn-color0);} \
.bp3-button-text path { fill: var(--jp-inverse-layout-color3);} \
.jp-icon-brand0 path { fill: var(--jp-brand-color0);} \
text.terms { fill: #616161;} \
</style>'
display(HTML(css_str ))
2

You have two conflicting versions of JupyterLab installed, one in the conda virtual environment and one outside of it. This leads to a conflict; the system responsible for icons was changed between versions. It will get fixed when you update to the same version (I highly recommend switching to 3.0, but you might be fine with just settling on 2.3).

First, check what version you have installed outside of the environment

conda deactivate
# note down the version
jupyter-lab --version
# check if it was installed with pip (if it is in there with the version listed above)
pip list
# otherwise, it should be on the conda list instead:
conda list

And then compare it to the version inside of the environment:

conda activate python_cvcourse
jupyter-lab --version

You will find that the version installed within you conda environment is older. If your installation that exists outside of the conda environment was installed with pip, I recommend uninstalling it:

conda deactivate
pip uninstall jupyterlab

Otherwise, if it was installed with conda, I recommend to upgrade it:

conda deactivate
conda update -c conda-forge jupyterlab

And finally you will need to upgrade the version inside of the conda environment:

conda activate python_cvcourse
conda update -c conda-forge jupyterlab
krassowski
  • 13,598
  • 4
  • 60
  • 92
  • My version outside the virtual env is `2.2.6` whereas the version inside the env is `0.34.9`. Now to check how the outside version was installed i use both `pip list` & `conda list` commands and i can find my version listed under both of them, so out of the two methods you siuggested which one should i proceed with? – Saksham Jain Apr 11 '21 at 09:04
  • 1
    Definitely uninstall `0.34.9`, it is way too old and maybe not secure any longer (like any software three major releases and multiple years since initial release). Try `pip uninstall jupyterlab`, possibly both outside of conda environment and inside of conda (no worries if one of those tells you that jupyterlab was not installed - it would be expected). Then proceed with upgrading using `conda update -c conda-forge jupyterlab` (preferably only inside the conda environment, but you will be probably fine if you also run it outside - as long as the versions match). – krassowski Apr 11 '21 at 15:29
  • 1
    As general advice goes, mixing `pip` and `conda` can lead to strange issues (like the one you experienced), see: https://stackoverflow.com/questions/56134588/is-that-a-bad-idea-to-use-conda-and-pip-install-on-the-same-environment. Only ever use pip inside conda when there is absolutely no way to install that package with conda/conda-forge/another conda channel (so you won't have conflicts in the future). – krassowski Apr 11 '21 at 15:33
  • 1
    Yes this works, i installed verson `3.0.13` inside the env now everything is fine, thanks – Saksham Jain Apr 11 '21 at 15:43