在JupyterLab中使用所需环境时,图标不显示

2024-04-19 00:54:25 发布

您现在位置:Python中文网/ 问答频道 /正文

我的jupyter实验室没有显示任何图标 下面是它是如何出现的enter image description here

这就是我使用这两个命令运行jupyter lab的时候

conda activate python_cvcourse
jupyter-lab

但如果我只使用

jupyter-lab

要启动jupyter笔记本(它没有创建我需要的环境),下面是笔记本的显示方式 enter image description here

你可以看到现在所有的图标是如何可见的,我不明白这里的问题是什么,我可以通过记住图标的位置来解决这个问题,但这不是很有帮助,我应该怎么做? 我使用的是windows 10,我使用的jupyter版本是

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

Tags: core命令版本环境windowslab笔记本jupyter
2条回答

您安装了两个相互冲突的JupyterLab版本,一个在conda虚拟环境中,另一个在conda虚拟环境之外。这导致了冲突;负责图标的系统在版本之间发生了更改。当你更新到同一个版本时,它会得到修复(我强烈建议切换到3.0,但你只需要选择2.3就可以了)

首先,检查您在环境之外安装的版本

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

然后将其与环境内部的版本进行比较:

conda activate python_cvcourse
jupyter-lab  version

您会发现在conda环境中安装的版本较旧如果您在conda环境之外的安装是与pip一起安装的,我建议您卸载它:

conda deactivate
pip uninstall jupyterlab

否则,如果它与conda一起安装,我建议升级:

conda deactivate
conda update -c conda-forge jupyterlab

最后,您需要升级conda环境中的版本:

conda activate python_cvcourse
conda update -c conda-forge jupyterlab

您的虚拟环境中是否安装了pyLDAvis?显然,有强有力的证据表明这是与派尔戴维斯的互动。你可以检查它here

要修复此问题,您可以在笔记本中执行:

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 ))

相关问题 更多 >