jupyterlab_code_formatter icon indicating copy to clipboard operation
jupyterlab_code_formatter copied to clipboard

module 'black' has no attribute '__version__'

Open RayShing opened this issue 3 years ago • 2 comments

Checklist prior to opening an issue

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

Describe the bug A clear and concise description of what the bug is. When click the button, it shows "Jupyterlab Code Formatter Error, module 'black' has no attribute 'version'" image

black version: 22.3 jupyterlab_code_formatter verison 1.4.11 JupyterLab version: 3.4.2

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

  • pip freeze black==22.3.0 jupyterlab-code-formatter==1.4.11

  • jupyter labextension list JupyterLab v3.4.2 /home/ruizhi/miniconda3/share/jupyter/labextensions jupyterlab-topbar-extension v0.6.1 enabled OK (python, jupyterlab-topbar) jupyterlab-system-monitor v0.8.0 enabled OK (python, jupyterlab-system-monitor) @ryantam626/jupyterlab_code_formatter v1.4.11 enabled OK (python, jupyterlab-code-formatter) @lckr/jupyterlab_variableinspector v3.0.9 enabled OK (python, lckr_jupyterlab_variableinspector) @jupyter-server/resource-usage v0.6.1 enabled OK (python, jupyter-resource-usage) @krassowski/jupyterlab-lsp v3.10.1 enabled OK (python, jupyterlab-lsp)

Other labextensions (built into JupyterLab) app dir: /home/ruizhi/miniconda3/share/jupyter/lab @jupyterlab/toc v5.4.2 enabled OK

  • jupyter serverextension list Config option kernel_spec_manager_class not recognized by ListServerExtensionsApp. config dir: /home/ruizhi/.jupyter jupyter_lsp disabled
    • Validating... jupyter_lsp 1.5.1 OK jupyter_kite disabled
    • Validating... Error loading server extension jupyter_kite X is jupyter_kite importable? config dir: /home/ruizhi/miniconda3/etc/jupyter jupyter_lsp enabled
    • Validating... jupyter_lsp 1.5.1 OK jupyter_resource_usage enabled
    • Validating... jupyter_resource_usage 0.6.1 OK jupyterlab enabled
    • Validating... jupyterlab 3.4.2 OK **jupyterlab_code_formatter enabled
    • Validating... jupyterlab_code_formatter 1.4.11 OK**

Screenshots

If applicable, add screenshots to help explain your problem. image

Additional context Add any other context about the problem here.

Maybe the reason is the version of black packeg?

RayShing avatar Jun 03 '22 18:06 RayShing

Update: degrade the version of black to 22.1.0 and it works. But it looks like it is a bug caused by the newest version of black. You should mention it or fix it :-)

RayShing avatar Jun 03 '22 18:06 RayShing

That's weird.. I just tried it with black==22.3.0 and I can't replicate this, is this still an issue if you try again with 22.3.0?

ryantam626 avatar Aug 06 '22 13:08 ryantam626

That's weird.. I just tried it with black==22.3.0 and I can't replicate this, is this still an issue if you try again with 22.3.0?

I was having the same issue today. Downgraded black and it resolved

gdebrun2 avatar Dec 10 '22 05:12 gdebrun2

Closing due to inactivity.

ryantam626 avatar May 05 '23 09:05 ryantam626