jupyterlab-contrib / jupyterlab_code_formatter

A JupyterLab plugin to facilitate invocation of code formatters.
https://jupyterlab-code-formatter.readthedocs.io/
MIT License
856 stars 55 forks source link

Jupyterlab Code Formatter Error in AWS SageMaker Studio #334

Open Remi-deronzier opened 8 months ago

Remi-deronzier commented 8 months ago

Environment

Issue Description

When attempting to format Python code using the jupyterlab-code-formatter extension within JupyterLab on AWS SageMaker Studio, the formatting action fails and triggers a "Jupyterlab Code Formatter Error, Not Found" error message. This occurs despite the extension appearing as enabled and properly validated within my environment.

Steps to Reproduce

  1. Launch JupyterLab session in AWS SageMaker Studio with the specified environment.
  2. Install jupyterlab-code-formatter version 2.2.1, along with black and isort.
  3. Verify the extension is enabled and validated through jupyter server extension list.
  4. Attempt to format a Python notebook or file using the jupyterlab-code-formatter icon.
  5. Encounter a pop-up error with the message "Jupyterlab Code Formatter Error: Not Found".

Additional Context

Despite the extensions being recognized and validated by the server, the formatting request fails. Notably, the environment and installation details have been double-checked for consistency and correctness.

Any guidance on troubleshooting or resolving this issue would be greatly appreciated.

Thanks a lot for your help :)

SergioG-M commented 6 months ago

Did you find any solution? I am getting the same error

Remi-deronzier commented 6 months ago

No, unfortunately not. Still the same problem on my side.

SergioG-M commented 6 months ago

I am surprised that no one else has this problem / care about this

shashank201192 commented 4 months ago

We had the same issue which got resolved after jupyter server restart using "/usr/local/bin/restart-jupyter-server" command.

tuliocasagrande commented 3 months ago

Here's a more complete setup provided by SageMaker team: https://github.com/aws-samples/sagemaker-studio-lifecycle-config-examples/blob/main/scripts/install-lsp-features/on-jupyter-server-start.sh#L73-L75

In short, you're missing restart-jupyter-server as @shashank201192 pointed out.