Help installing/running JupyterLab in a conda environment

Hi, I’m very unskilled with virtual environments, and I have been trying to use conda, from a mini-conda installation, for that. I know I might break things up because sometimes I need to pip install things on this environment and I know this can break the conda tracking of libraries, this could be one these instances.

I have tried uninstalling and re-installing with conda install jupyter and conda install jupyterlab. I get this error when trying to launch jupyter lab:

(blimp) [villares@L340 ~]$ jupyter lab
Traceback (most recent call last):
  File "/home/villares/miniconda3/envs/blimp/bin/jupyter-lab", line 6, in <module>
    from jupyterlab.labapp import main
  File "/home/villares/miniconda3/envs/blimp/lib/python3.7/site-packages/jupyterlab/", line 14, in <module>
    from jupyterlab_server import slugify, WORKSPACE_EXTENSION
  File "/home/villares/miniconda3/envs/blimp/lib/python3.7/site-packages/jupyterlab_server/", line 4, in <module>
    from .app import LabServerApp
  File "/home/villares/miniconda3/envs/blimp/lib/python3.7/site-packages/jupyterlab_server/", line 9, in <module>
    from .server import ServerApp
  File "/home/villares/miniconda3/envs/blimp/lib/python3.7/site-packages/jupyterlab_server/", line 20, in <module>
    from notebook.notebookapp import aliases, flags, NotebookApp as ServerApp
  File "/home/villares/miniconda3/envs/blimp/lib/python3.7/site-packages/notebook/", line 83, in <module>
    from .services.contents.manager import ContentsManager
  File "/home/villares/miniconda3/envs/blimp/lib/python3.7/site-packages/notebook/services/contents/", line 17, in <module>
    from nbformat import sign, validate as validate_nb, ValidationError
  File "/home/villares/miniconda3/envs/blimp/lib/python3.7/site-packages/nbformat/", line 32, in <module>
    from .validator import validate, ValidationError
  File "/home/villares/miniconda3/envs/blimp/lib/python3.7/site-packages/nbformat/", line 12, in <module>
    from .json_compat import get_current_validator, ValidationError
  File "/home/villares/miniconda3/envs/blimp/lib/python3.7/site-packages/nbformat/", line 10, in <module>
    import jsonschema
  File "/home/villares/miniconda3/envs/blimp/lib/python3.7/site-packages/jsonschema/", line 34, in <module>
    __version__ = metadata.version("jsonschema")
AttributeError: module 'importlib_metadata' has no attribute 'version'

Please advise…

If you think you’ve messed up your environment by pip installing something the easiest solution is probably to create a new conda environment, install JupyterLab and any other packages using conda, check everything works, and finally pip install the packages that aren’t available through conda.


Thanks, @manics!

I’m not sure how I broke my main env, but creating a fresh one got me running jupyter lab without doing anything else! Now I just have to watch out and see if I can avoid (or at least understand) the things that broke it.

1 Like