JupyterLab 4.2.0: ImportError: cannot import name 'get_allowed_levels' from 'jupyterlab_server.config'
trenton3983 opened this issue · comments
Description
Opened JupyterLab and was notified of a newer version 4.2.0, so I exited Jupyter, and used conda install jupyterlab=4.2.0
at the (base) conda prompt.
Typing jupyter lab
at (base) to launch, results in the following error:
(base) D:\users\trent\Dropbox\PythonProjects>jupyter lab
Traceback (most recent call last):
File "C:\Users\trent\anaconda3\Scripts\jupyter-lab-script.py", line 5, in <module>
from jupyterlab.labapp import main
File "C:\Users\trent\anaconda3\Lib\site-packages\jupyterlab\labapp.py", line 26, in <module>
from .commands import (
File "C:\Users\trent\anaconda3\Lib\site-packages\jupyterlab\commands.py", line 32, in <module>
from jupyterlab_server.config import (
ImportError: cannot import name 'get_allowed_levels' from 'jupyterlab_server.config' (C:\Users\trent\anaconda3\Lib\site-packages\jupyterlab_server\config.py)
jupyterlab_server 2.25.1 py311haa95532_0
is being used.
Reproduce
Launch jupyter lab
at the (base) conda prompt
Expected behavior
I expect jupyterlab to launch
Context
- Operating System and version: Windows 11
- Browser and version: Microsoft Edge Version 124.0.2478.80 (Official build) (64-bit)
- JupyterLab version: 4.2.0
Command Line Output
(base) D:\users\trent\Dropbox\PythonProjects>jupyter labTraceback (most recent call last):
File "C:\Users\trent\anaconda3\Scripts\jupyter-lab-script.py", line 5, in
from jupyterlab.labapp import main
File "C:\Users\trent\anaconda3\Lib\site-packages\jupyterlab\labapp.py", line 26, in
from .commands import (
File "C:\Users\trent\anaconda3\Lib\site-packages\jupyterlab\commands.py", line 32, in
from jupyterlab_server.config import (
ImportError: cannot import name 'get_allowed_levels' from 'jupyterlab_server.config' (C:\Users\trent\anaconda3\Lib\site-packages\jupyterlab_server\config.py)
Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋
Welcome to the Jupyter community! 🎉
JupyterLab 4.2.0 requires jupyterlab_server>=2.27.1,<3
but you have 2.25.1
installed:
Line 47 in 66bc3b0
Most likely you installed some packages using pip
and some using conda
which leads to incorrect resolution of dependencies.
I was able to do conda search -f jupyterlab_server
to get the current version and install it.
This was a new Anaconda installation, and I know better than to use pip
in my Anaconda distribution.
Thanks for the reply and for confirmation it is not pip/conda issue. It looks like the dependency pin on conda-forge was wrong, even though it was correct in RC. New builds generated after conda-forge/jupyterlab-feedstock#434 was merged should fix this.