Skip to content

ModuleNotFoundError: No module named 'pkg_resources' #58

@jtpio

Description

@jtpio

Description

With jupyter_ydoc==0.2.0 there seems to be an issue with missing pkg_resources:

lerna ERR! yarn run build:prod stderr:
Traceback (most recent call last):
  File "/tmp/build-env-sga8vbqf/bin/jupyter-labextension", line 5, in <module>
    from jupyterlab.labextensions import main
  File "/tmp/build-env-sga8vbqf/lib/python3.10/site-packages/jupyterlab/labextensions.py", line 37, in <module>
    from .labapp import LabApp
  File "/tmp/build-env-sga8vbqf/lib/python3.10/site-packages/jupyterlab/labapp.py", line 15, in <module>
    from jupyter_server_ydoc.ydoc import JupyterSQLiteYStore
  File "/tmp/build-env-sga8vbqf/lib/python3.10/site-packages/jupyter_server_ydoc/__init__.py", line 6, in <module>
    from .ydoc import YDocWebSocketHandler
  File "/tmp/build-env-sga8vbqf/lib/python3.10/site-packages/jupyter_server_ydoc/ydoc.py", line 11, in <module>
    from jupyter_ydoc import ydocs as YDOCS  # type: ignore
  File "/tmp/build-env-sga8vbqf/lib/python3.10/site-packages/jupyter_ydoc/__init__.py", line 1, in <module>
    import pkg_resources

Reproduce

This was noticed in jupyter/notebook#6539 (comment), with this example run: https://github.com/jupyter/notebook/actions/runs/3145280672/jobs/5112365511

In that case notebook uses hatch as the build backend but triggers commands from JupyterLab to build the extension, which probably explains why it hits the jupyter_ydoc path since there is a top-level import.

Expected behavior

Probably there should not be a dependency on pkg_resources?

Context

jupyter/notebook#6539 (comment)

  • Operating System and version: Ubuntu GitHub Actions
  • Browser and version: N/A
  • Jupyter Server version: 1.19.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions