Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError: No module named 'pkg_resources' #58

Closed
jtpio opened this issue Sep 28, 2022 · 3 comments · Fixed by #59
Closed

ModuleNotFoundError: No module named 'pkg_resources' #58

jtpio opened this issue Sep 28, 2022 · 3 comments · Fixed by #59
Labels
bug Something isn't working

Comments

@jtpio
Copy link
Member

jtpio commented Sep 28, 2022

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
@jtpio jtpio added the bug Something isn't working label Sep 28, 2022
@welcome
Copy link

welcome bot commented Sep 28, 2022

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

@jtpio
Copy link
Member Author

jtpio commented Sep 28, 2022

Looks like this might be related to #51.

Also 0.2.0 still seems to be a draft release at the moment:

image

@davidbrochart
Copy link
Collaborator

I tested it in a conda-forge environment, where setuptools is always installed with python, and I didn't see this issue, thanks for reporting @jtpio.
The Jupyter Releaser failed when releasing v0.2.0, and I had to publish manually. It should be fixed now 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants