jupyterlab_code_formatter: Jupyterlab Code Formatter Error Unable to find server plugin version

Checklist prior to opening an issue

  • I have followed fully the installation steps laid out in the documentation site.
  • I have restarted jupyterlab.
  • I have read the FAQ section in the documentation site.

Describe the bug After JupyterLab server start, opening a client yields the following popup:

Jupyterlab Code Formatter Error
Unable to find server plugin version, this should be impossible, open a GitHub issue if you cannot figure this issue out yourself.

Diagnostic commands Please attach the output of the following commands (please format them properly)

  • pip freeze
anyio==2.0.2
appdirs==1.4.4
argon2-cffi==20.1.0
arviz==0.10.0
astroid==2.4.2
async-generator==1.10
atomicwrites==1.1.5
attrs==20.3.0
Automat==20.2.0
autopep8==1.5.4
Babel==2.9.0
backcall==0.2.0
beautifulsoup4==4.9.3
black==20.8b1
bleach==3.2.1
blinker==1.4
boto==2.49.0
certifi==2020.12.5
cffi==1.14.4
cftime==1.3.0
chardet==4.0.0
click==7.1.2
cloud-init==20.4
colorama==0.4.4
command-not-found==0.3
configobj==5.0.6
constantly==15.1.0
cryptography==3.3.1
cssselect==1.1.0
cupshelpers==1.0
cvxopt==1.2.3
cycler==0.10.0
dbus-python==1.2.16
decorator==4.4.2
defer==1.0.6
defusedxml==0.6.0
dill==0.3.3
distro==1.5.0
distro-info===0.23ubuntu1
entrypoints==0.3
et-xmlfile==1.0.1
fastprogress==1.0.0
filelock==3.0.12
flake8==3.8.4
h5py==3.1.0
html5lib==1.1
httplib2==0.18.1
hyperlink==21.0.0
idna==2.10
importlib-metadata==3.4.0
incremental==17.5.0
ipykernel==5.4.3
ipympl==0.6.2
ipython==7.19.0
ipython-genutils==0.2.0
ipywidgets==7.6.3
isort==5.7.0
itemadapter==0.2.0
itemloaders==1.0.4
jdcal==1.0
jedi==0.17.2
jeepney==0.6.0
Jinja2==2.11.2
jmespath==0.10.0
joblib==0.14.0
json5==0.9.5
jsonpatch==1.28
jsonpointer==2.0
jsonschema==3.2.0
jupyter==1.0.0
jupyter-client==6.1.11
jupyter-console==6.2.0
jupyter-core==4.7.0
jupyter-resource-usage==0.5.1
jupyter-server==1.2.1
jupyterlab==3.0.4
jupyterlab-code-formatter==1.4.1
jupyterlab-pygments==0.1.2
jupyterlab-server==2.1.2
jupyterlab-widgets==1.0.0
keyring==21.8.0
kiwisolver==1.3.1
language-selector==0.1
launchpadlib==1.10.13
lazr.restfulclient==0.14.3
lazr.uri==1.0.5
lazy-object-proxy==1.4.3
llvmlite==0.31.0
lxml==4.6.2
macaroonbakery==1.3.1
MarkupSafe==1.1.1
matplotlib==3.3.3
mccabe==0.6.1
mistune==0.8.4
modbus-cli==0.1.3
more-itertools==8.6.0
mypy-extensions==0.4.3
mysqlclient==1.4.4
nbclassic==0.2.6
nbclient==0.5.1
nbconvert==6.0.7
nbformat==5.0.8
nest-asyncio==1.4.3
netCDF4==1.5.5.1
netifaces==0.10.9
nose==1.3.7
notebook==6.1.6
numba==0.48.0
numexpr==2.7.1
numpy==1.19.4
oauthlib==3.1.0
olefile==0.46
openpyxl==3.0.3
packaging==20.8
pandas==1.2.0
pandocfilters==1.4.3
parsel==1.6.0
parso==0.7.1
pathspec==0.8.1
patsy==0.5.1
pbr==5.5.1
pexpect==4.8.0
pickleshare==0.7.5
Pillow==8.1.0
pip-tools==5.5.0
pluggy==0.13.1
prometheus-client==0.9.0
prompt-toolkit==3.0.10
Protego==0.1.16
protobuf==3.14.0
psutil==5.8.0
ptyprocess==0.7.0
py==1.8.1
pyasn1==0.4.8
pyasn1-modules==0.2.8
pycairo==1.16.2
pycodestyle==2.6.0
pycparser==2.20
pycups==1.9.73
PyDispatcher==2.0.5
pydocstyle==5.1.1
pyflakes==2.2.0
pyftdi==0.52.9
Pygments==2.7.4
PyGObject==3.36.0
PyHamcrest==2.0.2
PyJWT==1.7.1
pylint==2.6.0
pymacaroons==0.13.0
pymc3==3.10.0
PyNaCl==1.4.0
pyOpenSSL==20.0.1
pyparsing==2.4.7
pyRFC3339==1.1
pyrsistent==0.17.3
pyserial==3.5
pytest==4.6.9
python-apt==2.0.0+ubuntu0.20.4.3
python-dateutil==2.8.1
python-debian==0.1.39
python-jsonrpc-server==0.4.0
python-language-server==0.36.2
pytz==2020.5
pyusb==1.1.0
PyYAML==5.3.1
pyzmq==20.0.0
qtconsole==5.0.1
QtPy==1.9.0
queuelib==1.5.0
regex==2020.11.13
requests==2.25.1
requests-unixsocket==0.2.0
rope==0.18.0
scikit-learn==0.22.2.post1
scipy==1.5.4
Scrapy==2.4.1
seaborn==0.11.1
SecretStorage==3.3.0
Send2Trash==1.5.0
service-identity==18.1.0
sidetable==0.8.0
simplejson==3.17.2
six==1.15.0
sklearn-pandas==1.8.0
sniffio==1.2.0
snowballstemmer==2.0.0
sos==4.0
soupsieve==2.1
ssh-import-id==5.11
statsmodels==0.11.1
systemd-python==234
tables==3.6.1
terminado==0.9.2
testpath==0.4.4
testresources==2.0.1
Theano==1.0.5
Theano-PyMC==1.1.0
toml==0.10.2
tornado==6.1
traitlets==5.0.5
Twisted==20.3.0
typed-ast==1.4.2
typing-extensions==3.7.4.3
ubuntu-advantage-tools==20.3
ufw==0.36
ujson==4.0.1
uModbus==1.0.4
unattended-upgrades==0.1
urllib3==1.26.2
w3lib==1.22.0
wadllib==1.3.4
wcwidth==0.2.5
webencodings==0.5.1
widgetsnbextension==3.5.1
wrapt==1.12.1
xarray==0.16.2
xlrd==1.1.0
xlwt==1.3.0
yapf==0.30.0
zipp==3.4.0
zope.interface==5.2.0
  • jupyter labextension list
JupyterLab v3.0.4
/home/bobc/.local/share/jupyter/labextensions
        jupyter-matplotlib v0.8.2 enabled OK
        @jupyter-widgets/jupyterlab-manager v3.0.0 enabled OK (python, jupyterlab_widgets)
        @ryantam626/jupyterlab_code_formatter v1.4.1 enabled OK (python, jupyterlab-code-formatter)
        @jupyter-server/resource-usage v0.5.0 enabled OK (python, jupyter-resource-usage)

Other labextensions (built into JupyterLab)
   app dir: /home/bobc/.local/share/jupyter/lab
        @krassowski/jupyterlab-lsp v2.1.0 enabled OK

  • jupyter serverextension list
config dir: /home/bobc/.jupyter
    jupyterlab_code_formatter  enabled
    - Validating...
      X is jupyterlab_code_formatter importable?

Screenshots

JupyterLab_error

Additional context

Running Python 3.8.5 under Ubuntu 20.04 under WSL2 under Windows 10. The rest is turtles all the way down.

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 13
  • Comments: 32 (5 by maintainers)

Most upvoted comments

After using @ekungurov’s suggestion, I found that python -c "import jupyterlab_code_formatter" failed with ImportError: cannot import name 'cache' from 'functools'. That package is only available in Python 3.9+ and I was on 3.8, so downgrading jupyterlab-code-formatter to 1.5.3 fixed the issue for me.

pip install jupyterlab-code-formatter==1.5.3

Could you run jupyter server extension enable --py jupyterlab_code_formatter and retry?

I think this line was removed from the README by mistake.

Thanks all! I just updated my pip install --user version of JupyterLab and had to set this in ~/.jupyter/jupyter_server_config.py:

c.ServerApp.jpserver_extensions = {
    "jupyterlab": True,
    "jupyterlab_code_formatter": True,
}

The ~/.jupyter/jupyter_server_config.py is necessary (and was not shown in the commented-out default value), because otherwise jupyter lab will not run at all.

One of the ways to troubleshoot is to run ‘jupyter serverextension list’. If it prints error message “Error loading server extension jupyterlab_code_formatter” then perform ‘import jupyterlab_code_formatter’ and investigate stack trace.

I too have been trying to get this setup on a JupyterHub/JupyterLab 3.0.5 setup on Ubuntu 18.04. Just tried the 1.4.2 release and still see the unknown version dialog message after restarting JupyterLab.

jupyter server extension enable --py jupyterlab_code_formatter –user

Works for me.

One oddity: The initial run failed due to /usr/etc not existing on my system, which I created globally writable. After successful installation, the file /usr/etc/jupyter/jupyter_server_config.d/jupyterlab_code_formatter.json had been created.

Shouldn’t that file have been created in my user-local Jupyter config area, ~/.jupyter?

Similar problem, annoying.

image

image

Could you run jupyter server extension enable --py jupyterlab_code_formatter and retry?

The above line seems to have resolved the popup warning. Still testing.

The solution for me is here: https://github.com/jupyterhub/jupyterhub/pull/3329/files Just add the env var to your dockerfile