Error in setting up JupyterLab For development

Why am i getting this error when running pip install -e “.[dev,test]”

The real error is further down in the logs, can you paste it in full here?

Sure, Here it is.

PS C:\Users\Darshan\Desktop\Open_Source\jupyterlab> pip install -e “.[dev,test]”
WARNING: Ignoring invalid distribution -rotobuf (c:\users\darshan\anaconda3\lib\site-packages)
WARNING: Ignoring invalid distribution -atplotlib (c:\users\darshan\anaconda3\lib\site-packages)
WARNING: Ignoring invalid distribution -rotobuf (c:\users\darshan\anaconda3\lib\site-packages)
WARNING: Ignoring invalid distribution -atplotlib (c:\users\darshan\anaconda3\lib\site-packages)
Obtaining file:///C:/Users/Darshan/Desktop/Open_Source/jupyterlab
  Installing build dependencies ... done
  Checking if build backend supports build_editable ... done
  Getting requirements to build editable ... done
  Installing backend dependencies ... done
  Preparing editable metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Preparing editable metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [118 lines of output]
      INFO:hatch_jupyter_builder.utils:Running jupyter-builder
      WARNING:hatch_jupyter_builder.utils:Refusing to overwrite pre-commit hook
      INFO:hatch_jupyter_builder.utils:Building with buildapi.builder
      INFO:hatch_jupyter_builder.utils:With kwargs: {'build_cmd': 'build', 'source_dir': 'packages', 'build_dir': 'dev_mode/static', 'npm': ['node', 'jupyterlab/staging/yarn.js']}
      INFO:hatch_jupyter_builder.utils:Installing build dependencies with npm.  This may take a while...
      INFO:hatch_jupyter_builder.utils:> "C:\Program Files\nodejs\node.EXE" jupyterlab/staging/yarn.js install
      ➤ YN0000: ┌ Project validation
      ➤ YN0057: │ @jupyterlab/application-top: Resolutions field will be ignored
      ➤ YN0057: │ @jupyterlab/example-federated-core: Resolutions field will be ignored
      ➤ YN0000: └ Completed
      ➤ YN0000: ┌ Resolution step
      ➤ YN0002: │ @jupyterlab/cell-toolbar-extension@workspace:packages/cell-toolbar-extension doesn't provide react (p9b3fb), requested by @jupyterlab/settingregistry
      ➤ YN0002: │ @jupyterlab/completer@workspace:packages/completer doesn't provide react (pb6629), requested by @jupyterlab/settingregistry
      ➤ YN0002: │ @jupyterlab/console-extension@workspace:packages/console-extension doesn't provide react (p43f42), requested by @jupyterlab/settingregistry
      ➤ YN0002: │ @jupyterlab/csvviewer-extension@workspace:packages/csvviewer-extension doesn't provide react (pc0654), requested by @jupyterlab/settingregistry
      ➤ YN0002: │ @jupyterlab/debugger-extension@workspace:packages/debugger-extension doesn't provide react (p03594), requested by @jupyterlab/settingregistry
      ➤ YN0002: │ @jupyterlab/documentsearch-extension@workspace:packages/documentsearch-extension doesn't provide react (p625eb), requested by @jupyterlab/settingregistry
      ➤ YN0002: │ @jupyterlab/extensionmanager-extension@workspace:packages/extensionmanager-extension doesn't provide react (pf4c35), requested by @jupyterlab/settingregistry
      ➤ YN0060: │ @jupyterlab/extensionmanager@workspace:packages/extensionmanager provides react (pc6bfe) with version 18.2.0, which doesn't satisfy what react-paginate requests
      ➤ YN0002: │ @jupyterlab/filebrowser-extension@workspace:packages/filebrowser-extension doesn't provide react (p297ab), requested by @jupyterlab/settingregistry
      ➤ YN0002: │ @jupyterlab/fileeditor-extension@workspace:packages/fileeditor-extension doesn't provide react (p034cc), requested by @jupyterlab/settingregistry
      ➤ YN0002: │ @jupyterlab/galata-extension@workspace:galata/extension doesn't provide react (p94674), requested by @jupyterlab/settingregistry
      ➤ YN0002: │ @jupyterlab/galata@workspace:galata doesn't provide react (pf71ca), requested by @jupyterlab/settingregistry
      ➤ YN0002: │ @jupyterlab/htmlviewer-extension@workspace:packages/htmlviewer-extension doesn't provide react (p251e4), requested by @jupyterlab/settingregistry
      ➤ YN0002: │ @jupyterlab/mainmenu-extension@workspace:packages/mainmenu-extension doesn't provide react (pe6ae9), requested by @jupyterlab/settingregistry
      ➤ YN0002: │ @jupyterlab/markdownviewer-extension@workspace:packages/markdownviewer-extension doesn't provide react (p3482b), requested by @jupyterlab/settingregistry
      ➤ YN0002: │ @jupyterlab/metadataform-extension@workspace:packages/metadataform-extension doesn't provide react (p7f08d), requested by @jupyterlab/settingregistry
      ➤ YN0002: │ @jupyterlab/metadataform@workspace:packages/metadataform doesn't provide @rjsf/utils (p26354), requested by @rjsf/core
      ➤ YN0002: │ @jupyterlab/metadataform@workspace:packages/metadataform doesn't provide @rjsf/utils (p4b312), requested by @rjsf/validator-ajv8
      ➤ YN0002: │ @jupyterlab/metapackage@workspace:packages/metapackage doesn't provide react (pc1a66), requested by @jupyterlab/settingregistry
      ➤ YN0060: │ @jupyterlab/repo-top@workspace:. provides stylelint (pb09b9) with version 15.10.1, which doesn't satisfy what stylelint-config-prettier requests
      ➤ YN0002: │ @jupyterlab/repo-top@workspace:. doesn't provide typescript (p38c70), requested by typedoc
      ➤ YN0002: │ @jupyterlab/services@workspace:packages/services doesn't provide react (p3d5c2), requested by @jupyterlab/settingregistry
      ➤ YN0002: │ @jupyterlab/settingeditor-extension@workspace:packages/settingeditor-extension doesn't provide react (p1bbc0), requested by @jupyterlab/settingregistry
      ➤ YN0002: │ @jupyterlab/statusbar-extension@workspace:packages/statusbar-extension doesn't provide react (pba42f), requested by @jupyterlab/settingregistry
      ➤ YN0002: │ @jupyterlab/terminal-extension@workspace:packages/terminal-extension doesn't provide react (p7805a), requested by @jupyterlab/settingregistry
      ➤ YN0002: │ @jupyterlab/toc-extension@workspace:packages/toc-extension doesn't provide react (p336fb), requested by @jupyterlab/settingregistry
      ➤ YN0002: │ @jupyterlab/translation-extension@workspace:packages/translation-extension doesn't provide react (p854cf), requested by @jupyterlab/settingregistry
      ➤ YN0002: │ @nrwl/devkit@npm:16.5.2 doesn't provide nx (p83c1a), requested by @nx/devkit
      ➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code
      ➤ YN0000: └ Completed in 0s 545ms
      ➤ YN0000: ┌ Fetch step
      ➤ YN0000: └ Completed in 0s 791ms
      ➤ YN0000: ┌ Link step
      ➤ YN0000: └ Completed in 1s 232ms
      ➤ YN0000: Done with warnings in 2s 729ms
      INFO:hatch_jupyter_builder.utils:> "C:\Program Files\nodejs\node.EXE" jupyterlab/staging/yarn.js run build

      > @jupyterlab/repo-top@0.0.1 build:dev
      > npm run integrity && npm run build:all && cd dev_mode && npm run build


      > @jupyterlab/repo-top@0.0.1 integrity
      > node scripts/ensure-buildutils.js && node buildutils/lib/ensure-repo.js


      > @jupyterlab/buildutils@4.3.0-alpha.0 clean
      > rimraf lib && rimraf tsconfig.tsbuildinfo


      > @jupyterlab/buildutils@4.3.0-alpha.0 build
      > tsc && cd template && npm run build


      > @jupyterlab/template@4.3.0-alpha.0 build
      > tsc -b


      > @jupyterlab/builder@4.3.0-alpha.0 clean
      > rimraf lib && rimraf tsconfig.tsbuildinfo


      > @jupyterlab/builder@4.3.0-alpha.0 build
      > tsc

      Error: EPERM: operation not permitted, symlink 'C:\Users\Darshan\Desktop\Open_Source\jupyterlab\builder\lib\build-labextension.js' -> 'C:\Users\Darshan\Desktop\Open_Source\jupyterlab\node_modules\.bin\build-labextension'
          at Object.symlinkSync (node:fs:1810:11)
          at C:\Users\Darshan\Desktop\Open_Source\jupyterlab\buildutils\lib\ensure-repo.js:628:16
          at Array.forEach (<anonymous>)
          at ensureBuildUtils (C:\Users\Darshan\Desktop\Open_Source\jupyterlab\buildutils\lib\ensure-repo.js:615:31)
          at ensureIntegrity (C:\Users\Darshan\Desktop\Open_Source\jupyterlab\buildutils\lib\ensure-repo.js:772:5) {
        errno: -4048,
        code: 'EPERM',
        syscall: 'symlink',
        path: 'C:\\Users\\Darshan\\Desktop\\Open_Source\\jupyterlab\\builder\\lib\\build-labextension.js',
        dest: 'C:\\Users\\Darshan\\Desktop\\Open_Source\\jupyterlab\\node_modules\\.bin\\build-labextension'
      }
      Traceback (most recent call last):
        File "C:\Users\Darshan\anaconda3\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 165, in prepare_metadata_for_build_editable
          hook = backend.prepare_metadata_for_build_editable
      AttributeError: module 'hatchling.build' has no attribute 'prepare_metadata_for_build_editable'

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
        File "C:\Users\Darshan\anaconda3\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 351, in <module>
          main()
        File "C:\Users\Darshan\anaconda3\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 333, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "C:\Users\Darshan\anaconda3\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 174, in prepare_metadata_for_build_editable
          whl_basename = build_hook(metadata_directory, config_settings)
        File "C:\Users\Darshan\AppData\Local\Temp\pip-build-env-_2dk4lbi\overlay\Lib\site-packages\hatchling\build.py", line 83, in build_editable
          return os.path.basename(next(builder.build(directory=wheel_directory, versions=['editable'])))
        File "C:\Users\Darshan\AppData\Local\Temp\pip-build-env-_2dk4lbi\overlay\Lib\site-packages\hatchling\builders\plugin\interface.py", line 147, in build
          build_hook.initialize(version, build_data)
        File "C:\Users\Darshan\AppData\Local\Temp\pip-build-env-_2dk4lbi\normal\Lib\site-packages\hatch_jupyter_builder\plugin.py", line 94, in initialize
          raise e
        File "C:\Users\Darshan\AppData\Local\Temp\pip-build-env-_2dk4lbi\normal\Lib\site-packages\hatch_jupyter_builder\plugin.py", line 89, in initialize
          build_func(self.target_name, version, **build_kwargs)
        File "C:\Users\Darshan\Desktop\Open_Source\jupyterlab\buildapi.py", line 20, in builder
          npm_builder(target_name, version, *args, **kwargs)
        File "C:\Users\Darshan\AppData\Local\Temp\pip-build-env-_2dk4lbi\normal\Lib\site-packages\hatch_jupyter_builder\utils.py", line 117, in npm_builder
          run([*npm_cmd, "run", build_cmd], cwd=str(abs_path))
        File "C:\Users\Darshan\AppData\Local\Temp\pip-build-env-_2dk4lbi\normal\Lib\site-packages\hatch_jupyter_builder\utils.py", line 231, in run
          return subprocess.check_call(cmd, **kwargs)
        File "C:\Users\Darshan\anaconda3\lib\subprocess.py", line 369, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['C:\\Program Files\\nodejs\\node.EXE', 'jupyterlab/staging/yarn.js', 'run', 'build']' returned non-zero exit status 1.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
WARNING: Ignoring invalid distribution -rotobuf (c:\users\darshan\anaconda3\lib\site-packages)
WARNING: Ignoring invalid distribution -atplotlib (c:\users\darshan\anaconda3\lib\site-packages)
WARNING: Ignoring invalid distribution -rotobuf (c:\users\darshan\anaconda3\lib\site-packages)
WARNING: Ignoring invalid distribution -atplotlib (c:\users\darshan\anaconda3\lib\site-packages)
WARNING: Ignoring invalid distribution -rotobuf (c:\users\darshan\anaconda3\lib\site-packages)
WARNING: Ignoring invalid distribution -atplotlib (c:\users\darshan\anaconda3\lib\site-packages)

I am using powershell on windows to setup my project. I have:
node version: v20.14.0
npm version: 10.8.1
python version: Python 3.11.3
pip version: pip 22.3.1

This is the relevant bit. You need to enable symlinks:

On Windows, symbolic links need to be activated on Windows 10 or above for Python version 3.8 or higher by activating the ‘Developer Mode’. That may not be allowed by your administrators. See Activate Developer Mode on Windows for instructions.

As documented, in the extension tutorial but it looks like this should be also mentioned in contributing section (please do send a PR if you agree).

1 Like

Thanks for you help.
I also think that including this information in contributing section would be very helpful for contributors. I’ll make a PR for this.

But after getting through 1 issue, i ran into another!
I’m following Docs to setup project. I now want to explore individual component. I ran:

jlpm run build:examples #build was successful
cd examples/filebrowser #entered into directory
python main.py #encountered error

The error message says:

PS C:\Users\Darshan\Desktop\Open_Source\jupyterlab\examples\filebrowser> python main.py
Traceback (most recent call last):
  File "C:\Users\Darshan\Desktop\Open_Source\jupyterlab\examples\filebrowser\main.py", line 18, in <module>
    from jupyterlab_server import LabServerApp
ModuleNotFoundError: No module named 'jupyterlab_server'

Do i have to setup some server before i can access components?

This means that you need to install jupyterlab_server package. It should have been installed when you did pip install -e ".[dev,test]".

While you may be able to solve it just by pip-installing it, if it did not get installed automatically I would suspect that you may be running into issues due to lack of activation of a vitual environment or due to non installing it in a virtual environment but having the python interpreter point to one. Also, for conda and pip to interact correctly you may need to install pip explicitly via conda first.

1 Like

Thanks @krassowski, everything works fine on a virtual environment. Excited to further explore JupyterLab’s codebase!

1 Like

@krassowski
I wanted to update docs. So, i followed docs which says:


But when i run these commands, nothing happens, my VS Code opens with typedoc.js file opened in jupyterlab’s directory.

How do i get access to docs in my browser? Is there any URL? I couldn’t find any solution in docs.

After running make html a directory called build/html will be created in jupyterlab/docs. You can then open it using any browser, either by dragging the file from your file browser (on most operating systems), entering the full local path prefixed by file:// or by using command line.

@krassowski
Yes, a directory ‘build/html’ is being created but don’t know why but its empty.
Here is the screen shot of my logs:

I tried using another approach too, but didn’t get any results

Same error arises when i run jlpm install:

This error does not seem familiar to me.

If making docs compile locally is too tricky, feel free to just open a draft PR - the docs will build on CI and you will be able to view the result in the browser.