Repository: jupyterhub/jupyterhub

Issue:
Unable to launch pods on JupyterHub when NBClassic 1.0.0 is installed
<!-- Thank you for contributing. These HTML comments will not render in the issue, but you can delete them once you've read them if you prefer! -->

### Bug description

<!-- Use this section to clearly and concisely describe the bug. -->
We're using JupyterHub 3.0.0 and are trying to launch a notebook from it that has JupyterLab 4.0.6, Notebook 7.0.4, and nbclassic 1.0.0. When we remove nbclassic the notebook launches fine, but when it's installed, we get a `ImportError: No module named IPythonHandler` error.

### How to reproduce

<!-- Use this section to describe the steps that a user would take to experience this bug. -->

This happens when launching a pod from the spawner. It gets to "container started" but the container itself glitches out. This doesn't happen when the pod is launched through a regular k8s manifest.

#### Expected behaviour

<!-- Tell us what you thought would happen. -->
For the pod to launch.

#### Actual behaviour

<!-- Tell us what actually happens. -->
The pod does not launch, it errors out (logs below).

### Your personal set up

<!--
Tell us a little about the system you're using.
Please include information about how you installed,
e.g. are you using a distribution such as zero-to-jupyterhub or the-littlest-jupyterhub.
 -->
We're using zero-to-jupyterhub with JupyterHub 3.0.0.

 - OS:
 CentOS 7 (but the notebook is containerized).
 - Version(s):
 Jupyterhub 3.0 Python 3.9

<details><summary>Full environment</summary>
<!-- For reproduction, it's useful to have the full environment. For example, the output of `pip freeze` or `conda list` --->

```
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       1_gnu    conda-forge
_r-mutex                  1.0.1               anacondar_1    conda-forge
alembic                   1.12.1                   pypi_0    pypi
altair                    4.1.0                      py_1    conda-forge
anyio                     3.2.1            py39hf3d152e_0    conda-forge
appdirs                   1.4.4              pyh9f0ad1d_0    conda-forge
argon2-cffi               20.1.0           py39h3811e60_2    conda-forge
arrow                     1.3.0                    pypi_0    pypi
asttokens                 2.4.1                    pypi_0    pypi
async-lru                 2.0.4                    pypi_0    pypi
async_generator           1.10                       py_0    conda-forge
attrs                     23.1.0                   pypi_0    pypi
babel                     2.13.1                   pypi_0    pypi
backcall                  0.2.0              pyh9f0ad1d_0    conda-forge
backports                 1.0                        py_2    conda-forge
backports.functools_lru_cache 1.6.4              pyhd8ed1ab_0    conda-forge
beautifulsoup4            4.9.3              pyhb0f4dca_0    conda-forge
binutils_impl_linux-64    2.36.1               h193b22a_1    conda-forge
binutils_linux-64         2.36                hf3e587d_33    conda-forge
blas                      1.1                    openblas    conda-forge
bleach                    3.3.1              pyhd8ed1ab_0    conda-forge
blinker                   1.4                        py_1    conda-forge
blosc                     1.21.0               h9c3ff4c_0    conda-forge
bokeh                     2.3.3            py39hf3d152e_0    conda-forge
bottleneck                1.3.2            py39hce5d2b2_3    conda-forge
branca                    0.7.0                    pypi_0    pypi
brotli                    1.0.9                h7f98852_5    conda-forge
brotli-bin                1.0.9                h7f98852_5    conda-forge
brotlipy                  0.7.0           py39h3811e60_1001    conda-forge
brunsli                   0.1                  h9c3ff4c_0    conda-forge
bwidget                   1.9.14               ha770c72_0    conda-forge
bzip2                     1.0.8                h7f98852_4    conda-forge
c-ares                    1.17.1               h7f98852_1    conda-forge
ca-certificates           2021.5.30            ha878542_0    conda-forge
cached-property           1.5.2                hd8ed1ab_1    conda-forge
cached_property           1.5.2              pyha770c72_1    conda-forge
cairo                     1.16.0            h6cf1ce9_1008    conda-forge
certifi                   2021.5.30        py39hf3d152e_0    conda-forge
certipy                   0.1.3                      py_0    conda-forge
cffi                      1.14.6           py39he32792d_0    conda-forge
cfitsio                   3.470                hb418390_7    conda-forge
chardet                   4.0.0            py39hf3d152e_1    conda-forge
charls                    2.2.0                h9c3ff4c_0    conda-forge
charset-normalizer        2.0.0              pyhd8ed1ab_0    conda-forge
click                     8.0.1            py39hf3d152e_0    conda-forge
cloudpickle               1.6.0                      py_0    conda-forge
colorama                  0.4.6                    pypi_0    pypi
comm                      0.2.0                    pypi_0    pypi
conda                     4.10.2           py39hf3d152e_0    conda-forge
conda-package-handling    1.7.3            py39h3811e60_0    conda-forge
configurable-http-proxy   4.5.0           node15_he6ea98c_0    conda-forge
cryptography              3.4.7            py39hbca0aa6_0    conda-forge
curl                      7.77.0               hea6ffbf_0    conda-forge
cycler                    0.10.0                     py_2    conda-forge
cython                    0.29.24          py39he80948d_0    conda-forge
cytoolz                   0.11.0           py39h3811e60_3    conda-forge
dask                      2021.6.2           pyhd8ed1ab_0    conda-forge
dask-core                 2021.6.2           pyhd8ed1ab_0    conda-forge
datascience               0.17.6                   pypi_0    pypi
debugpy                   1.8.0                    pypi_0    pypi
decorator                 5.0.9              pyhd8ed1ab_0    conda-forge
defusedxml                0.7.1              pyhd8ed1ab_0    conda-forge
dill                      0.3.4              pyhd8ed1ab_0    conda-forge
distributed               2021.6.2         py39hf3d152e_0    conda-forge
dpkt                      1.9.8                    pypi_0    pypi
entrypoints               0.3             pyhd8ed1ab_1003    conda-forge
env-backup                0.0.3                    pypi_0    pypi
exceptiongroup            1.2.0                    pypi_0    pypi
executing                 2.0.1                    pypi_0    pypi
fastjsonschema            2.19.0                   pypi_0    pypi
folium                    0.15.0                   pypi_0    pypi
font-ttf-dejavu-sans-mono 2.37                 hab24e00_0    conda-forge
font-ttf-inconsolata      3.000                h77eed37_0    conda-forge
font-ttf-source-code-pro  2.038                h77eed37_0    conda-forge
font-ttf-ubuntu           0.83                 hab24e00_0    conda-forge
fontconfig                2.13.1            hba837de_1005    conda-forge
fonts-conda-ecosystem     1                             0    conda-forge
fonts-conda-forge         1                             0    conda-forge
fqdn                      1.5.1                    pypi_0    pypi
freetype                  2.10.4               h0708190_1    conda-forge
fribidi                   1.0.10               h36c2ea0_0    conda-forge
fsspec                    2021.7.0           pyhd8ed1ab_0    conda-forge
gcc_impl_linux-64         9.3.0               h70c0ae5_19    conda-forge
gcc_linux-64              9.3.0               hf25ea35_33    conda-forge
gettext                   0.19.8.1          h0b5b191_1005    conda-forge
gfortran_impl_linux-64    9.3.0               hc4a2995_19    conda-forge
gfortran_linux-64         9.3.0               hdc58fab_33    conda-forge
giflib                    5.2.1                h36c2ea0_2    conda-forge
gitdb                     4.0.11                   pypi_0    pypi
gitpython                 3.1.40                   pypi_0    pypi
gmp                       6.2.1                h58526e2_0    conda-forge
gmpy2                     2.1.0b5          py39h78fa15d_0    conda-forge
gputil                    1.4.0                    pypi_0    pypi
graphite2                 1.3.13            h58526e2_1001    conda-forge
greenlet                  1.1.0            py39he80948d_0    conda-forge
gsl                       2.6                  he838d99_2    conda-forge
gxx_impl_linux-64         9.3.0               hd87eabc_19    conda-forge
gxx_linux-64              9.3.0               h3fbe746_33    conda-forge
h5py                      3.3.0           nompi_py39h98ba4bc_100    conda-forge
harfbuzz                  2.8.2                h83ec7ef_0    conda-forge
hdf5                      1.10.6          nompi_h6a2412b_1114    conda-forge
heapdict                  1.0.1                      py_0    conda-forge
icu                       68.1                 h58526e2_0    conda-forge
idna                      3.1                pyhd3deb0d_0    conda-forge
imagecodecs               2021.6.8         py39h44211f0_0    conda-forge
imageio                   2.9.0                      py_0    conda-forge
importlib-metadata        6.8.0                    pypi_0    pypi
iniconfig                 2.0.0                    pypi_0    pypi
install                   1.3.5                    pypi_0    pypi
ipykernel                 6.27.1                   pypi_0    pypi
ipympl                    0.7.0              pyhd8ed1ab_0    conda-forge
ipython                   8.18.1                   pypi_0    pypi
ipython_genutils          0.2.0                      py_1    conda-forge
ipywidgets                7.6.3              pyhd3deb0d_0    conda-forge
isoduration               20.11.0                  pypi_0    pypi
jbig                      2.1               h7f98852_2003    conda-forge
jedi                      0.18.0           py39hf3d152e_2    conda-forge
jinja2                    3.1.2                    pypi_0    pypi
joblib                    1.0.1              pyhd8ed1ab_0    conda-forge
jpeg                      9d                   h36c2ea0_0    conda-forge
json5                     0.9.5              pyh9f0ad1d_0    conda-forge
jsonpointer               2.4                      pypi_0    pypi
jsonschema                4.20.0                   pypi_0    pypi
jsonschema-specifications 2023.11.2                pypi_0    pypi
jupyter-client            8.6.0                    pypi_0    pypi
jupyter-core              5.5.0                    pypi_0    pypi
jupyter-events            0.9.0                    pypi_0    pypi
jupyter-lsp               2.2.1                    pypi_0    pypi
jupyter-server            2.4.0                    pypi_0    pypi
jupyter-server-mathjax    0.2.6                    pypi_0    pypi
jupyter-server-terminals  0.4.4                    pypi_0    pypi
jupyter_telemetry         0.1.0              pyhd8ed1ab_1    conda-forge
jupyterhub                3.0.0            py39hf3d152e_0    conda-forge
jupyterhub-base           3.0.0            py39hf3d152e_0    conda-forge
jupyterlab                4.0.6                    pypi_0    pypi
jupyterlab-fasta          3.3.0                    pypi_0    pypi
jupyterlab-geojson        3.4.0                    pypi_0    pypi
jupyterlab-git            0.50.0                   pypi_0    pypi
jupyterlab-github         4.0.0                    pypi_0    pypi
jupyterlab-latex          3.0.0                    pypi_0    pypi
jupyterlab-link-share     0.3.0                    pypi_0    pypi
jupyterlab-pullrequests   0.3.0                    pypi_0    pypi
jupyterlab-rise           0.41.0                   pypi_0    pypi
jupyterlab-server         2.25.2                   pypi_0    pypi
jupyterlab_pygments       0.1.2              pyh9f0ad1d_0    conda-forge
jupyterlab_widgets        1.0.0              pyhd8ed1ab_1    conda-forge
jxrlib                    1.1                  h7f98852_2    conda-forge
kernel-headers_linux-64   2.6.32              he073ed8_14    conda-forge
kiwisolver                1.3.1            py39h1a9c180_1    conda-forge
krb5                      1.19.1               hcc1bbae_0    conda-forge
lcms2                     2.12                 hddcbb42_0    conda-forge
ld_impl_linux-64          2.36.1               hea4e1c9_1    conda-forge
lerc                      2.2.1                h9c3ff4c_0    conda-forge
libaec                    1.0.5                h9c3ff4c_0    conda-forge
libarchive                3.5.1                hccf745f_2    conda-forge
libblas                   3.9.0                9_openblas    conda-forge
libbrotlicommon           1.0.9                h7f98852_5    conda-forge
libbrotlidec              1.0.9                h7f98852_5    conda-forge
libbrotlienc              1.0.9                h7f98852_5    conda-forge
libcblas                  3.9.0                9_openblas    conda-forge
libcurl                   7.77.0               h2574ce0_0    conda-forge
libdeflate                1.7                  h7f98852_5    conda-forge
libedit                   3.1.20191231         he28a2e2_2    conda-forge
libev                     4.33                 h516909a_1    conda-forge
libffi                    3.3                  h58526e2_2    conda-forge
libgcc-devel_linux-64     9.3.0               h7864c58_19    conda-forge
libgcc-ng                 9.3.0               h2828fa1_19    conda-forge
libgfortran-ng            9.4.0                h69a702a_0    conda-forge
libgfortran5              9.4.0                h62347ff_0    conda-forge
libgit2                   1.1.1                hee63804_1    conda-forge
libglib                   2.68.3               h3e27bee_0    conda-forge
libgomp                   9.3.0               h2828fa1_19    conda-forge
libiconv                  1.16                 h516909a_0    conda-forge
liblapack                 3.9.0                9_openblas    conda-forge
libllvm10                 10.0.1               he513fc3_3    conda-forge
libnghttp2                1.43.0               h812cca2_0    conda-forge
libopenblas               0.3.15          pthreads_h8fe5266_1    conda-forge
libpng                    1.6.37               h21135ba_2    conda-forge
libprotobuf               3.17.2               h780b84a_1    conda-forge
libsodium                 1.0.18               h36c2ea0_1    conda-forge
libsolv                   0.7.19               h780b84a_5    conda-forge
libssh2                   1.9.0                ha56f1ee_6    conda-forge
libstdcxx-devel_linux-64  9.3.0               hb016644_19    conda-forge
libstdcxx-ng              9.3.0               h6de172a_19    conda-forge
libtiff                   4.3.0                hf544144_1    conda-forge
libuuid                   2.32.1            h7f98852_1000    conda-forge
libuv                     1.41.1               h7f98852_0    conda-forge
libwebp-base              1.2.0                h7f98852_2    conda-forge
libxcb                    1.13              h7f98852_1003    conda-forge
libxml2                   2.9.12               h72842e0_0    conda-forge
libzopfli                 1.0.3                h9c3ff4c_0    conda-forge
llvmlite                  0.36.0           py39h1bbdace_0    conda-forge
locket                    0.2.0                      py_2    conda-forge
lz4-c                     1.9.3                h9c3ff4c_0    conda-forge
lzo                       2.10              h516909a_1000    conda-forge
make                      4.3                  hd18ef5c_1    conda-forge
mako                      1.1.4              pyh44b312d_0    conda-forge
mamba                     0.15.2           py39h951de11_0    conda-forge
markupsafe                2.0.1            py39h3811e60_0    conda-forge
matplotlib-base           3.4.2            py39h2fa2bec_0    conda-forge
matplotlib-inline         0.1.2              pyhd8ed1ab_2    conda-forge
mistune                   2.0.5                    pypi_0    pypi
mock                      4.0.3            py39hf3d152e_1    conda-forge
mpc                       1.1.0             h04dde30_1009    conda-forge
mpfr                      4.0.2                he80fd80_1    conda-forge
mpmath                    1.2.1              pyhd8ed1ab_0    conda-forge
msgpack-python            1.0.2            py39h1a9c180_1    conda-forge
nbclassic                 1.0.0                    pypi_0    pypi
nbclient                  0.9.0                    pypi_0    pypi
nbconvert                 7.2.1                    pypi_0    pypi
nbdime                    4.0.1                    pypi_0    pypi
nbformat                  5.9.2                    pypi_0    pypi
nbgitpuller               1.2.1.dev0               pypi_0    pypi
nbgrader                  0.9.0                    pypi_0    pypi
nbresuse                  0.2.0                    pypi_0    pypi
ncurses                   6.2                  h58526e2_4    conda-forge
nest-asyncio              1.5.1              pyhd8ed1ab_0    conda-forge
networkx                  2.5                        py_0    conda-forge
nltk                      3.8.1                    pypi_0    pypi
nodejs                    15.14.0              h92b4a50_0    conda-forge
nose                      1.3.7                    pypi_0    pypi
notebook                  7.0.4                    pypi_0    pypi
notebook-shim             0.2.3                    pypi_0    pypi
numba                     0.53.1           py39h56b8d98_1    conda-forge
numexpr                   2.7.3            py39hde0f152_0    conda-forge
numpy                     1.21.1           py39hdbf815f_0    conda-forge
oauthlib                  3.1.1              pyhd8ed1ab_0    conda-forge
olefile                   0.46               pyh9f0ad1d_1    conda-forge
openblas                  0.3.15          pthreads_h4748800_1    conda-forge
openjpeg                  2.4.0                hb52868f_1    conda-forge
openssl                   1.1.1k               h7f98852_0    conda-forge
overrides                 7.4.0                    pypi_0    pypi
packaging                 23.2                     pypi_0    pypi
pamela                    1.0.0                      py_0    conda-forge
pandas                    2.0.3                    pypi_0    pypi
pandoc                    2.14.0.3             h7f98852_0    conda-forge
pandocfilters             1.4.2                      py_1    conda-forge
pango                     1.48.7               hb8ff022_0    conda-forge
parso                     0.8.2              pyhd8ed1ab_0    conda-forge
partd                     1.2.0              pyhd8ed1ab_0    conda-forge
patsy                     0.5.4                    pypi_0    pypi
pcre                      8.45                 h9c3ff4c_0    conda-forge
pcre2                     10.37                h032f7d1_0    conda-forge
pexpect                   4.8.0              pyh9f0ad1d_2    conda-forge
pickleshare               0.7.5                   py_1003    conda-forge
pillow                    8.3.1            py39ha612740_0    conda-forge
pip                       21.1.3             pyhd8ed1ab_0    conda-forge
pixman                    0.40.0               h36c2ea0_0    conda-forge
platformdirs              4.0.0                    pypi_0    pypi
plotly                    5.18.0                   pypi_0    pypi
pluggy                    1.3.0                    pypi_0    pypi
pooch                     1.4.0              pyhd8ed1ab_0    conda-forge
prometheus_client         0.11.0             pyhd8ed1ab_0    conda-forge
prompt-toolkit            3.0.41                   pypi_0    pypi
protobuf                  3.17.2           py39he80948d_0    conda-forge
psutil                    5.8.0            py39h3811e60_1    conda-forge
pthread-stubs             0.4               h36c2ea0_1001    conda-forge
ptyprocess                0.7.0              pyhd3deb0d_0    conda-forge
pure-eval                 0.2.2                    pypi_0    pypi
pycosat                   0.6.3           py39h3811e60_1006    conda-forge
pycparser                 2.20               pyh9f0ad1d_2    conda-forge
pycurl                    7.43.0.6         py39h72e3413_1    conda-forge
pygments                  2.9.0              pyhd8ed1ab_0    conda-forge
pyjwt                     2.1.0              pyhd8ed1ab_0    conda-forge
pyopenssl                 20.0.1             pyhd8ed1ab_0    conda-forge
pyparsing                 2.4.7              pyh9f0ad1d_0    conda-forge
pyrsistent                0.17.3           py39h3811e60_2    conda-forge
pysocks                   1.7.1            py39hf3d152e_3    conda-forge
pytables                  3.6.1            py39hf6dc253_3    conda-forge
pytest                    7.4.3                    pypi_0    pypi
python                    3.9.5           h49503c6_0_cpython    conda-forge
python-dateutil           2.8.2              pyhd8ed1ab_0    conda-forge
python-editor             1.0.4                      py_0    conda-forge
python-json-logger        2.0.7                    pypi_0    pypi
python_abi                3.9                      2_cp39    conda-forge
pytz                      2021.1             pyhd8ed1ab_0    conda-forge
pywavelets                1.1.1            py39hce5d2b2_3    conda-forge
pyyaml                    6.0.1                    pypi_0    pypi
pyzmq                     25.1.1                   pypi_0    pypi
r-askpass                 1.1               r41hcfec24a_2    conda-forge
r-assertthat              0.2.1             r41hc72bb7e_2    conda-forge
r-backports               1.2.1             r41hcfec24a_0    conda-forge
r-base                    4.1.0                hb67fd72_2    conda-forge
r-base64enc               0.1_3           r41hcfec24a_1004    conda-forge
r-bit                     4.0.4             r41hcfec24a_0    conda-forge
r-bit64                   4.0.5             r41hcfec24a_0    conda-forge
r-bitops                  1.0_7             r41hcfec24a_0    conda-forge
r-blob                    1.2.2             r41hc72bb7e_0    conda-forge
r-brew                    1.0_6           r41hc72bb7e_1003    conda-forge
r-brio                    1.1.2             r41hcfec24a_0    conda-forge
r-broom                   0.7.8             r41hc72bb7e_0    conda-forge
r-bslib                   0.2.5.1           r41hc72bb7e_0    conda-forge
r-cachem                  1.0.5             r41hcfec24a_0    conda-forge
r-callr                   3.7.0             r41hc72bb7e_0    conda-forge
r-caret                   6.0_88            r41hcfec24a_0    conda-forge
r-cellranger              1.1.0           r41hc72bb7e_1003    conda-forge
r-class                   7.3_19            r41hcfec24a_0    conda-forge
r-cli                     3.0.1             r41hc72bb7e_0    conda-forge
r-clipr                   0.7.1             r41hc72bb7e_0    conda-forge
r-codetools               0.2_18            r41hc72bb7e_0    conda-forge
r-colorspace              2.0_2             r41hcfec24a_0    conda-forge
r-commonmark              1.7             r41hcfec24a_1002    conda-forge
r-conflicted              1.0.4             r41hc72bb7e_2    conda-forge
r-covr                    3.5.1             r41h03ef668_0    conda-forge
r-cpp11                   0.3.1             r41hc72bb7e_0    conda-forge
r-crayon                  1.4.1             r41hc72bb7e_0    conda-forge
r-credentials             1.3.1             r41hc72bb7e_0    conda-forge
r-crosstalk               1.1.1             r41hc72bb7e_0    conda-forge
r-curl                    4.3.2             r41hcfec24a_0    conda-forge
r-data.table              1.14.0            r41hcfec24a_0    conda-forge
r-dbi                     1.1.1             r41hc72bb7e_0    conda-forge
r-dbplyr                  2.1.1             r41hc72bb7e_0    conda-forge
r-desc                    1.3.0             r41hc72bb7e_0    conda-forge
r-devtools                2.4.2             r41hc72bb7e_0    conda-forge
r-dials                   0.0.9             r41hc72bb7e_0    conda-forge
r-dicedesign              1.9               r41hcfec24a_0    conda-forge
r-diffobj                 0.3.4             r41hcfec24a_0    conda-forge
r-digest                  0.6.27            r41h03ef668_0    conda-forge
r-dplyr                   1.0.7             r41h03ef668_0    conda-forge
r-dt                      0.18              r41hc72bb7e_0    conda-forge
r-dtplyr                  1.1.0             r41hc72bb7e_0    conda-forge
r-ellipsis                0.3.2             r41hcfec24a_0    conda-forge
r-evaluate                0.14              r41hc72bb7e_2    conda-forge
r-fansi                   0.4.2             r41hcfec24a_0    conda-forge
r-farver                  2.1.0             r41h03ef668_0    conda-forge
r-fastmap                 1.1.0             r41h03ef668_0    conda-forge
r-forcats                 0.5.1             r41hc72bb7e_0    conda-forge
r-foreach                 1.5.1             r41hc72bb7e_0    conda-forge
r-forecast                8.15              r41h6dc32e9_0    conda-forge
r-fracdiff                1.5_1             r41hbfbffee_1    conda-forge
r-fs                      1.5.0             r41h03ef668_0    conda-forge
r-furrr                   0.2.3             r41hc72bb7e_0    conda-forge
r-future                  1.21.0            r41hc72bb7e_0    conda-forge
r-gargle                  1.2.0             r41hc72bb7e_0    conda-forge
r-generics                0.1.0             r41hc72bb7e_0    conda-forge
r-gert                    1.3.1             r41hbd84cd2_0    conda-forge
r-ggplot2                 3.3.5             r41hc72bb7e_0    conda-forge
r-gh                      1.3.0             r41hc72bb7e_0    conda-forge
r-git2r                   0.28.0            r41hf628c3e_0    conda-forge
r-gitcreds                0.1.1             r41hc72bb7e_0    conda-forge
r-globals                 0.14.0            r41hc72bb7e_0    conda-forge
r-glue                    1.4.2             r41hcfec24a_0    conda-forge
r-googledrive             2.0.0             r41hc72bb7e_0    conda-forge
r-googlesheets4           0.3.0             r41hc72bb7e_0    conda-forge
r-gower                   0.2.2             r41hcfec24a_0    conda-forge
r-gpfit                   1.0_8             r41hc72bb7e_1    conda-forge
r-gtable                  0.3.0             r41hc72bb7e_3    conda-forge
r-hardhat                 0.1.6             r41hc72bb7e_0    conda-forge
r-haven                   2.4.1             r41h2713e49_0    conda-forge
r-hexbin                  1.28.2            r41h859d828_0    conda-forge
r-highr                   0.9               r41hc72bb7e_0    conda-forge
r-hms                     1.1.0             r41hc72bb7e_0    conda-forge
r-htmltools               0.5.1.1           r41h03ef668_0    conda-forge
r-htmlwidgets             1.5.3             r41hc72bb7e_0    conda-forge
r-httpuv                  1.6.1             r41h03ef668_0    conda-forge
r-httr                    1.4.2             r41hc72bb7e_0    conda-forge
r-ids                     1.0.1             r41hc72bb7e_1    conda-forge
r-infer                   0.5.4             r41hc72bb7e_0    conda-forge
r-ini                     0.3.1           r41hc72bb7e_1003    conda-forge
r-ipred                   0.9_11            r41hcfec24a_0    conda-forge
r-irdisplay               1.0               r41hd8ed1ab_0    conda-forge
r-irkernel                1.2               r41hc72bb7e_0    conda-forge
r-isoband                 0.2.5             r41h03ef668_0    conda-forge
r-iterators               1.0.13            r41hc72bb7e_0    conda-forge
r-jquerylib               0.1.4             r41hc72bb7e_0    conda-forge
r-jsonlite                1.7.2             r41hcfec24a_0    conda-forge
r-kernsmooth              2.23_20           r41h742201e_0    conda-forge
r-knitr                   1.33              r41hc72bb7e_0    conda-forge
r-labeling                0.4.2             r41hc72bb7e_0    conda-forge
r-later                   1.2.0             r41h03ef668_0    conda-forge
r-lattice                 0.20_44           r41hcfec24a_0    conda-forge
r-lava                    1.6.9             r41hc72bb7e_0    conda-forge
r-lazyeval                0.2.2             r41hcfec24a_2    conda-forge
r-lhs                     1.1.1             r41h03ef668_0    conda-forge
r-lifecycle               1.0.0             r41hc72bb7e_0    conda-forge
r-listenv                 0.8.0             r41hc72bb7e_1    conda-forge
r-lmtest                  0.9_38            r41h859d828_1    conda-forge
r-lubridate               1.7.10            r41h03ef668_0    conda-forge
r-magrittr                2.0.1             r41hcfec24a_1    conda-forge
r-markdown                1.1               r41hcfec24a_1    conda-forge
r-mass                    7.3_54            r41hcfec24a_0    conda-forge
r-matrix                  1.3_4             r41he454529_0    conda-forge
r-memoise                 2.0.0             r41hc72bb7e_0    conda-forge
r-mgcv                    1.8_36            r41he454529_0    conda-forge
r-mime                    0.11              r41hcfec24a_0    conda-forge
r-modeldata               0.1.1             r41hc72bb7e_0    conda-forge
r-modelmetrics            1.2.2.2           r41h03ef668_1    conda-forge
r-modelr                  0.1.8             r41hc72bb7e_0    conda-forge
r-munsell                 0.5.0           r41hc72bb7e_1003    conda-forge
r-nlme                    3.1_152           r41h859d828_0    conda-forge
r-nnet                    7.3_16            r41hcfec24a_0    conda-forge
r-numderiv                2016.8_1.1        r41hc72bb7e_3    conda-forge
r-nycflights13            1.0.2             r41hc72bb7e_0    conda-forge
r-openssl                 1.4.4             r41he36bf35_0    conda-forge
r-parallelly              1.27.0            r41hc72bb7e_0    conda-forge
r-parsnip                 0.1.7             r41hc72bb7e_0    conda-forge
r-pbdzmq                  0.3_5             r41h42bf92c_1    conda-forge
r-pillar                  1.6.1             r41hc72bb7e_0    conda-forge
r-pkgbuild                1.2.0             r41hc72bb7e_0    conda-forge
r-pkgconfig               2.0.3             r41hc72bb7e_1    conda-forge
r-pkgload                 1.2.1             r41h03ef668_0    conda-forge
r-plogr                   0.2.0           r41hc72bb7e_1003    conda-forge
r-plyr                    1.8.6             r41h03ef668_1    conda-forge
r-praise                  1.0.0           r41hc72bb7e_1004    conda-forge
r-prettyunits             1.1.1             r41hc72bb7e_1    conda-forge
r-proc                    1.17.0.1          r41h03ef668_0    conda-forge
r-processx                3.5.2             r41hcfec24a_0    conda-forge
r-prodlim                 2019.11.13        r41h03ef668_1    conda-forge
r-progress                1.2.2             r41hc72bb7e_2    conda-forge
r-promises                1.2.0.1           r41h03ef668_0    conda-forge
r-ps                      1.6.0             r41hcfec24a_0    conda-forge
r-purrr                   0.3.4             r41hcfec24a_1    conda-forge
r-quadprog                1.5_8             r41h742201e_3    conda-forge
r-quantmod                0.4.18            r41hc72bb7e_0    conda-forge
r-r6                      2.5.0             r41hc72bb7e_0    conda-forge
r-randomforest            4.6_14          r41h859d828_1004    conda-forge
r-rappdirs                0.3.3             r41hcfec24a_0    conda-forge
r-rcmdcheck               1.3.3             r41hc72bb7e_3    conda-forge
r-rcolorbrewer            1.1_2           r41h785f33e_1003    conda-forge
r-rcpp                    1.0.7             r41h03ef668_0    conda-forge
r-rcpparmadillo           0.10.6.0.0        r41h306847c_0    conda-forge
r-rcurl                   1.98_1.3          r41hcfec24a_0    conda-forge
r-readr                   1.4.0             r41h03ef668_0    conda-forge
r-readxl                  1.3.1             r41h2713e49_4    conda-forge
r-recipes                 0.1.16            r41hc72bb7e_0    conda-forge
r-rematch                 1.0.1           r41hc72bb7e_1003    conda-forge
r-rematch2                2.1.2             r41hc72bb7e_1    conda-forge
r-remotes                 2.4.0             r41hc72bb7e_0    conda-forge
r-repr                    1.1.3             r41h785f33e_0    conda-forge
r-reprex                  2.0.0             r41hc72bb7e_0    conda-forge
r-reshape2                1.4.4             r41h03ef668_1    conda-forge
r-rex                     1.2.0             r41hc72bb7e_1    conda-forge
r-rlang                   0.4.11            r41hcfec24a_0    conda-forge
r-rmarkdown               2.9               r41hc72bb7e_1    conda-forge
r-rodbc                   1.3_17            r41hcfec24a_0    conda-forge
r-roxygen2                7.1.1             r41h03ef668_0    conda-forge
r-rpart                   4.1_15            r41hcfec24a_2    conda-forge
r-rprojroot               2.0.2             r41hc72bb7e_0    conda-forge
r-rsample                 0.1.0             r41hc72bb7e_0    conda-forge
r-rsqlite                 2.2.5             r41h03ef668_0    conda-forge
r-rstudioapi              0.13              r41hc72bb7e_0    conda-forge
r-rversions               2.1.1             r41hc72bb7e_0    conda-forge
r-rvest                   1.0.0             r41hc72bb7e_0    conda-forge
r-sass                    0.4.0             r41h03ef668_0    conda-forge
r-scales                  1.1.1             r41hc72bb7e_0    conda-forge
r-selectr                 0.4_2             r41hc72bb7e_1    conda-forge
r-sessioninfo             1.1.1           r41hc72bb7e_1002    conda-forge
r-shiny                   1.6.0             r41hc72bb7e_0    conda-forge
r-slider                  0.2.2             r41hcfec24a_0    conda-forge
r-sourcetools             0.1.7           r41h9c3ff4c_1002    conda-forge
r-squarem                 2021.1            r41hc72bb7e_0    conda-forge
r-stringi                 1.7.3             r41hcabe038_0    conda-forge
r-stringr                 1.4.0             r41hc72bb7e_2    conda-forge
r-survival                3.2_11            r41hcfec24a_0    conda-forge
r-sys                     3.4               r41hcfec24a_0    conda-forge
r-testthat                3.0.4             r41h03ef668_0    conda-forge
r-tibble                  3.1.3             r41hcfec24a_0    conda-forge
r-tidymodels              0.1.3             r41hc72bb7e_0    conda-forge
r-tidyr                   1.1.3             r41h03ef668_0    conda-forge
r-tidyselect              1.1.1             r41hc72bb7e_0    conda-forge
r-tidyverse               1.3.1             r41hc72bb7e_0    conda-forge
r-timedate                3043.102        r41hc72bb7e_1002    conda-forge
r-tinytex                 0.32              r41hc72bb7e_0    conda-forge
r-tseries                 0.10_48           r41h742201e_0    conda-forge
r-ttr                     0.24.2            r41hcfec24a_0    conda-forge
r-tune                    0.1.6             r41hc72bb7e_0    conda-forge
r-urca                    1.3_0           r41h859d828_1006    conda-forge
r-usethis                 2.0.1             r41hc72bb7e_0    conda-forge
r-utf8                    1.2.2             r41hcfec24a_0    conda-forge
r-uuid                    0.1_4             r41hcfec24a_1    conda-forge
r-vctrs                   0.3.8             r41hcfec24a_1    conda-forge
r-viridislite             0.4.0             r41hc72bb7e_0    conda-forge
r-waldo                   0.2.5             r41hc72bb7e_0    conda-forge
r-warp                    0.2.0             r41hcfec24a_1    conda-forge
r-whisker                 0.4               r41hc72bb7e_1    conda-forge
r-withr                   2.4.2             r41hc72bb7e_0    conda-forge
r-workflows               0.2.3             r41hc72bb7e_0    conda-forge
r-workflowsets            0.1.0             r41hc72bb7e_0    conda-forge
r-xfun                    0.24              r41h03ef668_0    conda-forge
r-xml2                    1.3.2             r41h03ef668_1    conda-forge
r-xopen                   1.0.0           r41hc72bb7e_1003    conda-forge
r-xtable                  1.8_4             r41hc72bb7e_3    conda-forge
r-xts                     0.12.1            r41hcfec24a_0    conda-forge
r-yaml                    2.2.1             r41hcfec24a_1    conda-forge
r-yardstick               0.0.8             r41h03ef668_0    conda-forge
r-zip                     2.2.0             r41hcfec24a_0    conda-forge
r-zoo                     1.8_9             r41hcfec24a_1    conda-forge
rapidfuzz                 3.5.2                    pypi_0    pypi
readline                  8.1                  h46c0cb4_0    conda-forge
referencing               0.31.1                   pypi_0    pypi
regex                     2023.10.3                pypi_0    pypi
reproc                    14.2.1               h36c2ea0_0    conda-forge
reproc-cpp                14.2.1               h58526e2_0    conda-forge
requests                  2.31.0                   pypi_0    pypi
requests-unixsocket       0.2.0                      py_0    conda-forge
rfc3339-validator         0.1.4                    pypi_0    pypi
rfc3986-validator         0.1.1                    pypi_0    pypi
rpds-py                   0.13.2                   pypi_0    pypi
rpy2                      3.4.5           py39r41hce5d2b2_0    conda-forge
ruamel.yaml               0.17.10          py39h3811e60_0    conda-forge
ruamel.yaml.clib          0.2.2            py39h3811e60_2    conda-forge
ruamel_yaml               0.15.80         py39h3811e60_1004    conda-forge
scikit-image              0.18.2           py39hde0f152_0    conda-forge
scikit-learn              0.24.2           py39h4dfa638_0    conda-forge
scipy                     1.7.0            py39hee8e79c_1    conda-forge
seaborn                   0.11.1               hd8ed1ab_1    conda-forge
seaborn-base              0.11.1             pyhd8ed1ab_1    conda-forge
sed                       4.8                  he412f7d_0    conda-forge
send2trash                1.8.2                    pypi_0    pypi
setuptools                49.6.0           py39hf3d152e_3    conda-forge
simplegeneric             0.8.1                      py_1    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
smmap                     5.0.1                    pypi_0    pypi
snappy                    1.1.8                he1b5a44_3    conda-forge
sniffio                   1.2.0            py39hf3d152e_1    conda-forge
sortedcontainers          2.4.0              pyhd8ed1ab_0    conda-forge
soupsieve                 2.0.1                      py_1    conda-forge
sqlalchemy                1.4.22           py39h3811e60_0    conda-forge
sqlite                    3.36.0               h9cd32fc_0    conda-forge
stack-data                0.6.3                    pypi_0    pypi
statsmodels               0.14.0                   pypi_0    pypi
sympy                     1.8              py39hf3d152e_0    conda-forge
sysroot_linux-64          2.12                he073ed8_14    conda-forge
tblib                     1.7.0              pyhd8ed1ab_0    conda-forge
tenacity                  8.2.3                    pypi_0    pypi
terminado                 0.10.1           py39hf3d152e_0    conda-forge
testpath                  0.5.0              pyhd8ed1ab_0    conda-forge
threadpoolctl             2.2.0              pyh8a188c0_0    conda-forge
tifffile                  2021.7.2           pyhd8ed1ab_0    conda-forge
timeout-decorator         0.5.0                    pypi_0    pypi
tinycss2                  1.2.1                    pypi_0    pypi
tk                        8.6.10               h21135ba_1    conda-forge
tktable                   2.10                 hb7b940f_3    conda-forge
tomli                     2.0.1                    pypi_0    pypi
toolz                     0.11.1                     py_0    conda-forge
tornado                   6.4                      pypi_0    pypi
tqdm                      4.61.2             pyhd8ed1ab_1    conda-forge
traitlets                 5.14.0                   pypi_0    pypi
types-python-dateutil     2.8.19.14                pypi_0    pypi
typing-extensions         4.8.0                    pypi_0    pypi
tzdata                    2023.3                   pypi_0    pypi
tzlocal                   2.1                pyh9f0ad1d_0    conda-forge
unixodbc                  2.3.9                hb166930_0    conda-forge
uri-template              1.3.0                    pypi_0    pypi
urllib3                   1.26.6             pyhd8ed1ab_0    conda-forge
wcwidth                   0.2.5              pyh9f0ad1d_2    conda-forge
webcolors                 1.13                     pypi_0    pypi
webencodings              0.5.1                      py_1    conda-forge
websocket-client          0.57.0           py39hf3d152e_4    conda-forge
wheel                     0.36.2             pyhd3deb0d_0    conda-forge
widgetsnbextension        3.5.1            py39hf3d152e_4    conda-forge
xlrd                      2.0.1              pyhd8ed1ab_3    conda-forge
xorg-kbproto              1.0.7             h7f98852_1002    conda-forge
xorg-libice               1.0.10               h7f98852_0    conda-forge
xorg-libsm                1.2.3             hd9c2040_1000    conda-forge
xorg-libx11               1.7.2                h7f98852_0    conda-forge
xorg-libxau               1.0.9                h7f98852_0    conda-forge
xorg-libxdmcp             1.1.3                h7f98852_0    conda-forge
xorg-libxext              1.3.4                h7f98852_1    conda-forge
xorg-libxrender           0.9.10            h7f98852_1003    conda-forge
xorg-libxt                1.2.1                h7f98852_2    conda-forge
xorg-renderproto          0.11.1            h7f98852_1002    conda-forge
xorg-xextproto            7.3.0             h7f98852_1002    conda-forge
xorg-xproto               7.0.31            h7f98852_1007    conda-forge
xz                        5.2.5                h516909a_1    conda-forge
yaml                      0.2.5                h516909a_0    conda-forge
zeromq                    4.3.4                h9c3ff4c_0    conda-forge
zfp                       0.5.5                h9c3ff4c_5    conda-forge
zict                      2.0.0                      py_0    conda-forge
zipp                      3.5.0              pyhd8ed1ab_0    conda-forge
zlib                      1.2.11            h516909a_1010    conda-forge
zstd                      1.5.0                ha95c52a_0    conda-forge
```
</details>

<details><summary>Configuration</summary>
<!--
For JupyterHub, especially include information such as what Spawner and Authenticator are being used.
Be careful not to share any sensitive information.
You can paste jupyterhub_config.py below.
To exclude lots of comments and empty lines from auto-generated jupyterhub_config.py, you can do:
    grep -v '\(^#\|^[[:space:]]*$\)' jupyterhub_config.py
-->

```python

class PatchedSpawner(kubespawner.KubeSpawner):
    async def _ensure_namespace(self):
        return

c.JupyterHub.spawner_class = PatchedSpawner

c.KubeSpawner.enable_user_namespaces = True
c.KubeSpawner.pod_name_template = 'dsmlp-jupyter-{legacy_escape_username}'
c.KubeSpawner.start_timeout = 300
c.KubeSpawner.user_namespace_template = '{legacy_escape_username}'

c.KubeSpawner.init_containers = []
c.KubeSpawner.args = []
c.KubeSpawner.k8s_api_request_timeout = 30
c.KubeSpawner.k8s_api_request_retry_timeout = 60


# SAML stuff
def extract_username(acs_handler, attributes):
    return attributes['urn:mace:ucsd.edu:sso:ad:username'][0]

c.SAMLAuthenticator.cache_spec = {
    'type': 'in-memory',
    'client': None,
    'client_kwargs': None
}


c.SAMLAuthenticator.idp_logout = True
c.SAMLAuthenticator.logout_kwargs = {}

c.SAMLAuthenticator.saml_settings_path = 'redacted'
c.SAMLAuthenticator.login_service = 'redacted'
c.SAMLAuthenticator.session_cookie_names = {'_gid', '_ga'}
c.SAMLAuthenticator.extract_username = extract_username
c.JupyterHub.authenticator_class = 'jupyterhub_saml_auth.SAMLAuthenticator'

```
</details>

Logs

```
_   _          _      _
 | | | |_ __  __| |__ _| |_ ___
 | |_| | '_ \/ _` / _` |  _/ -_)
  \___/| .__/\__,_\__,_|\__\___|
       |_|

Read the migration plan to Notebook 7 to learn about the new features and the actions to take if you are using extensions.

https://jupyter-notebook.readthedocs.io/en/latest/migrate_to_notebook7.html

Please note that updating to Notebook 7 might break some of your extensions.

Traceback (most recent call last):
  File "/opt/conda/lib/python3.9/site-packages/traitlets/utils/importstring.py", line 33, in import_item
    pak = getattr(module, obj)
AttributeError: module 'notebook.base.handlers' has no attribute 'IPythonHandler'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/conda/bin/jupyter-labhub", line 8, in <module>
    sys.exit(main())
  File "/opt/conda/lib/python3.9/site-packages/jupyterlab/labhubapp.py", line 41, in main
    return SingleUserLabApp.launch_instance(argv)
  File "/opt/conda/lib/python3.9/site-packages/jupyter_core/application.py", line 280, in launch_instance
    super().launch_instance(argv=argv, **kwargs)
  File "/opt/conda/lib/python3.9/site-packages/traitlets/config/application.py", line 1076, in launch_instance
    app.initialize(argv)
  File "/opt/conda/lib/python3.9/site-packages/jupyterhub/singleuser/mixins.py", line 843, in initialize
    _patch_app_base_handlers(self)
  File "/opt/conda/lib/python3.9/site-packages/jupyterhub/singleuser/mixins.py", line 764, in _patch_app_base_handlers
    base_handlers.append(import_item(base_handler_name))
  File "/opt/conda/lib/python3.9/site-packages/traitlets/utils/importstring.py", line 35, in import_item
    raise ImportError("No module named %s" % obj) from e
ImportError: No module named IPythonHandler
```

Thanks!


Discussion:
Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
<br>If you haven't done so already, check out [Jupyter's Code of Conduct](https://github.com/jupyter/governance/blob/master/conduct/code_of_conduct.md). Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
![welcome](https://raw.githubusercontent.com/jupyterhub/.github/master/images/welcome.jpg)
You can meet the other [Jovyans](https://jupyter.readthedocs.io/en/latest/community/content-community.html?highlight=jovyan#what-is-a-jovyan) by joining our [Discourse forum](http://discourse.jupyter.org/). There is also an intro thread there where you can stop by and say Hi! :wave:
<br>Welcome to the Jupyter community! :tada:

For compatibility with the latest breaking changes to the notebook package, I think you may need to upgrade JupyterHub to 4.x.

I believe I can prepare a fix, but I'm not sure if/when it will be backported, since the new way (JupyterHub-singleuser as a jupyter-server extension) works correctly.

Resolving patch:
diff --git a/jupyterhub/singleuser/mixins.py b/jupyterhub/singleuser/mixins.py
--- a/jupyterhub/singleuser/mixins.py
+++ b/jupyterhub/singleuser/mixins.py
@@ -856,13 +856,21 @@ def _patch_app_base_handlers(app):
     if BaseHandler is not None:
         base_handlers.append(BaseHandler)
 
-    # patch juptyer_server and notebook handlers if they have been imported
+    # patch jupyter_server and notebook handlers if they have been imported
     for base_handler_name in [
         "jupyter_server.base.handlers.JupyterHandler",
         "notebook.base.handlers.IPythonHandler",
     ]:
         modname, _ = base_handler_name.rsplit(".", 1)
         if modname in sys.modules:
+            root_mod = modname.partition(".")[0]
+            if root_mod == "notebook":
+                import notebook
+
+                if int(notebook.__version__.partition(".")[0]) >= 7:
+                    # notebook 7 is a server extension,
+                    # it doesn't have IPythonHandler anymore
+                    continue
             base_handlers.append(import_item(base_handler_name))
 
     if not base_handlers:


Test patch: