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

Distribution name unknown → No package metadata was found for notebook #7542

Open
3 tasks done
Geremia opened this issue Dec 17, 2024 · 2 comments
Open
3 tasks done
Labels
bug status:Needs Triage Applied to issues that need triage

Comments

@Geremia
Copy link

Geremia commented Dec 17, 2024

  • I checked the documentation and found no answer
  • I checked to make sure that this issue has not already been filed
  • I'm reporting the issue to the correct repository

cf. discourse.jupyter.org posting

Description

I get this problem:

$ jupyter-notebook 
Traceback (most recent call last):
  File "/usr/lib64/python3.12/importlib/metadata/__init__.py", line 397, in from_name
    return next(cls.discover(name=name))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
StopIteration

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/jupyter-notebook", line 33, in <module>
    sys.exit(load_entry_point('notebook==6.5.7', 'console_scripts', 'jupyter-notebook')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/bin/jupyter-notebook", line 22, in importlib_load_entry_point
    for entry_point in distribution(dist_name).entry_points
                       ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/importlib/metadata/__init__.py", line 862, in distribution
    return Distribution.from_name(distribution_name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/importlib/metadata/__init__.py", line 399, in from_name
    raise PackageNotFoundError(name)
importlib.metadata.PackageNotFoundError: No package metadata was found for notebook

It seems to struggle with determining what my distribution_name is.

Context

  • Operating System and version: Linux Slackware64-current
$ jupyter --version
Selected Jupyter core packages...
IPython          : 8.18.1
ipykernel        : 6.29.5
ipywidgets       : not installed
jupyter_client   : 8.6.3
jupyter_core     : 5.7.2
jupyter_server   : 2.10.0
jupyterlab       : not installed
nbclient         : 0.10.0
nbconvert        : 7.16.4
nbformat         : 5.10.4
notebook         : not installed
qtconsole        : not installed
traitlets        : 5.14.3
  • Jupyter Notebook version: 6.5.7
Troubleshoot Output
        /opt/cuda-12.6/bin
        /opt/cuda-12.6/nsight_compute
        /opt/cuda-12.6/nsight_systems/bin
        /usr/lib64/zulu-openjdk21/bin
        /usr/share/bin
        /usr/lib64/go1.22.7/go/bin
        /opt/cuda-12.6/bin
        /opt/cuda-12.6/nsight_compute
        /opt/cuda-12.6/nsight_systems/bin
        /usr/local/bin
        /usr/bin
        /bin
        /usr/games
        /opt/blender
        /usr/lib64/libexec/kf5
        /usr/lib64/qt5/bin
        /usr/lib64/qt6/bin
        /usr/local
        /usr/share/cuda/bin

sys.path:
/usr/bin
/usr/lib64/python312.zip
/usr/lib64/python3.12
/usr/lib64/python3.12/lib-dynload
/usr/lib64/python3.12/site-packages
/usr/lib/python3.12/site-packages

sys.executable:
/usr/bin/python3

sys.version:
3.12.8 (main, Dec 4 2024, 14:07:02) [GCC 14.2.0]

platform.platform():
Linux-6.12.1-x86_64-AMD_Ryzen_Threadripper_2990WX_32-Core_Processor-with-glibc2.40

which -a jupyter:
/usr/bin/jupyter

pip list:
Package Version
----------------------------- ------------------
acme 3.0.1
aiohttp 3.10.10
aiohttp_socks 0.9.0
aiorpcX 0.22.1
aiosignal 1.3.1
alabaster 1.0.0
anyio 4.6.2.post1
appdirs 1.4.4
argon2-cffi 23.1.0
argon2-cffi-bindings 21.2.0
asciidoc 10.2.0
asn1crypto 1.5.1
asttokens 2.4.1
async_generator 1.10
async-timeout 4.0.3
attrs 23.2.0
babel 2.16.0
backcall 0.2.0
beautifulsoup4 4.12.3
beniget 0.4.2.post1
bitstring 3.1.9
bleach 6.1.0
blinker 1.9.0
Brotli 1.1.0
bsddb3 6.2.6
build 1.2.2.post1
caca 0.99b20
calver 2022.6.26
certbot 3.0.1
certbot-apache 3.0.1
certbot-nginx 3.0.1
certifi 2024.12.14
cffi 1.17.1
chardet 5.2.0
charset-normalizer 3.4.0
click 8.1.7
comm 0.2.2
ConfigArgParse 1.7
configobj 5.0.9
contextlib2 0.6.0.post1
cppy 1.2.1
cryptography 44.0.0
cssselect 1.2.0
cssutils 1.0.2
CT3 3.3.2
cupshelpers 1.0
cupshelpers 1.0
cycler 0.11.0
Cython 3.0.11
debugpy 1.8.9
decorator 5.1.1
defusedxml 0.7.1
deprecation 2.1.0
distro 1.9.0
dnspython 2.7.0
docutils 0.21.2
doxypypy 0.8.8.7
doxyqml 0.5.3
ecdsa 0.18.0
editables 0.5
Electrum 4.5.8
entrypoints 0.4
exceptiongroup 1.2.2
executing 2.1.0
expandvars 0.12.0
fastjsonschema 2.20.0
filelock 3.16.1
filetype 1.2.0
flake8 7.0.0
Flask 3.1.0
Flask-Cors 5.0.0
flit_core 3.10.1
flit_scm 1.7.0
frescobaldi 3.1.3
frozenlist 1.5.0
future 1.0.0
gajim 1.5.4
gast 0.5.5
gaupol 1.15
getmail6 6.19.5
gi-docgen 2024.1
glad2 2.0.8
google_images_download 2.8.0
gpg 1.24.1
gramps 5.1.2
grpcio 1.67.1
grpcio-tools 1.67.1
gunicorn 22.0.0
gyp 0.1
hachoir 3.3.0
hatch-fancy-pypi-readme 24.1.0
hatch-jupyter-builder 0.9.1
hatch-nodejs-version 0.3.2
hatch-vcs 0.4.0
hatchling 1.26.3
helpdev 0.7.1
html5lib 1.1
idna 3.10
imagesize 1.4.1
img2pdf 0.4.0
importlib_metadata 8.5.0
include_server 3.4
iniconfig 2.0.0
installer 0.7.0
internetarchive 3.0.1
ipykernel 6.29.5
ipython 8.18.1
ipython_genutils 0.2.0
itsdangerous 2.1.2
jedi 0.19.2
Jinja2 3.1.4
joblib 1.4.2
josepy 1.14.0
jsonpatch 1.33
jsonpointer 3.0.0
jsonrpclib-pelix 0.4.3.2
jsonschema 4.17.3
jupyter_client 8.6.3
jupyter_core 5.7.2
jupyter-events 0.6.3
jupyter_packaging 0.12.3
jupyter_server 2.10.0
jupyter_server_terminals 0.5.3
jupyterlab_pygments 0.3.0
kapidox 5.116.0
kiwisolver 1.4.7
krop 0.6.1
lensfun 0.3.4
libtorrent 2.0.10
lxml 5.3.0
Mako 1.3.5
marisa 0.0.0
Markdown 3.7
markdown-it-py 3.0.0
MarkupSafe 3.0.2
matplotlib 3.8.4
matplotlib-inline 0.1.7
maturin 1.7.6
mdurl 0.1.2
mercurial 6.9
meson 1.6.0
meson-python 0.17.1
miniupnpc 2.2.5
mistune 2.0.5
mock 2.0.0
monotonic 1.1
more-itertools 10.5.0
mpmath 1.3.0
msgpack 1.0.2
multidict 6.1.0
munch 4.0.0
mutagen 1.47.0
nbclient 0.10.0
nbconvert 7.16.4
nbformat 5.10.4
nbxmpp 3.2.5
nest_asyncio 1.6.0
netsnmp-python 1.0a1
networkx 2.8.8
nftables 0.1
nltk 3.9.1
notebook_shim 0.2.4
notify2 0.3.1
numba 0.59.1
numpy 1.26.3
overrides 7.7.0
OWSLib 0.31.0
packaging 24.2
pandocfilters 1.5.1
parsedatetime 2.6
parso 0.8.4
pathspec 0.12.1
pbr 6.1.0
pefile 2023.2.7
pexpect 4.9.0
picard 2.12.3
pickleshare 0.7.5
pillow 11.0.0
pip 24.3.1
pkgconfig 1.5.5
platformdirs 4.3.6
pluggy 1.5.0
ply 3.11
poetry-core 1.9.1
prometheus_client 0.21.0
prompt_toolkit 3.0.47
protobuf 5.29.1
pssh 2.3.5
psutil 6.1.0
psycopg2 2.9.9
ptyprocess 0.7.0
pure_eval 0.2.3
pwquality 1.4.5
pyasn1 0.6.0
pybind11 2.11.1
pycairo 1.27.0
pycodestyle 2.11.1
pycparser 2.22
pycryptodomex 3.21.0
pycups 2.0.4
pycurl 7.45.4
pyenchant 3.2.2
Pygments 2.18.0
PyGObject 3.50.0
PyOpenGL 3.1.6
pyOpenSSL 24.3.0
pyparsing 3.1.2
PyPDF2 1.26.0
pypng 0.20220715.0
pyproject_hooks 1.2.0
pyproject-metadata 0.9.0
PyQt-builder 1.17.0
PyQt5 5.15.11
PyQt5_sip 12.16.1
pyRFC3339 1.1
pyrsistent 0.20.0
PySocks 1.6.8
pysol_cards 0.18.0
pytest 8.3.3
pytest-runner 6.0.1
python-augeas 1.2.0
python-axolotl 0.2.3
python-axolotl-curve25519 0.4.1.post2
python-dateutil 2.9.0
python-json-logger 2.0.7
python-ly 0.9.7
python-sane 2.9.1
python-socks 2.5.3
pythondialog 3.5.3
pythran 0.15.0
pytz 2024.2
pyxdg 0.28
PyYAML 6.0.2
pyzmq 25.1.2
QDarkStyle 3.2.3
qrcode 8.0
QScintilla 2.14.1
QtPy 2.4.2
random2 1.0.2
regex 2024.11.6
requests 2.32.3
requests-toolbelt 0.9.1
rich 13.9.4
rpm 4.20.0
schema 0.7.2
scikit-learn 1.4.0
scipy 1.12.0
SCons 4.8.1
screenkey 1.5
selenium 3.141.0
semantic_version 2.10.0
Send2Trash 1.8.3
setuptools 75.6.0
setuptools_autover 1.0.2
setuptools-rust 0.12.1
setuptools-scm 8.1.0
sip 6.9.1
six 1.17.0
smartypants 2.0.1
sniffio 1.3.1
snowballstemmer 2.2.0
soupsieve 2.6
speedtest-cli 2.1.3
Sphinx 8.1.3
sphinx_rtd_theme 3.0.2
sphinxcontrib-applehelp 2.0.0
sphinxcontrib-devhelp 2.0.0
sphinxcontrib-htmlhelp 2.1.0
sphinxcontrib-jquery 4.1
sphinxcontrib-jsmath 1.0.1
sphinxcontrib-qthelp 2.0.0
sphinxcontrib-serializinghtml 2.0.0
SQLAlchemy 2.0.36
stack_data 0.6.3
sympy 1.11.1
termcolor 2.4.0
terminado 0.18.1
testpath 0.6.0
threadpoolctl 3.5.0
tinycss2 1.3.0
toml 0.10.2
tomli_w 1.1.0
tomlkit 0.13.2
torch 2.5.0a0+gitunknown
tornado 6.4.2
tqdm 4.66.1
traitlets 5.14.3
trove-classifiers 2024.10.21.16
typing_extensions 4.12.2
typogrify 2.0.7
tzdata 2024.2
undervolt 0.4.0
Unidecode 1.3.8
urllib3 2.2.3
vcversioner 2.16.0.0
versioneer 0.29
waitress 3.0.0
wcwidth 0.2.13
webencodings 0.5.1
websocket-client 1.8.0
Werkzeug 3.1.3
wheel 0.45.1
yara-python 4.5.0
yarl 1.15.2
youtube_dl 2021.12.17
yt-dlp 2024.12.13
zenmap 7.95
zim 0.75.2
zipp 3.21.0
zope.component 6.0
zope.event 5.0
zope.interface 6.4.post2

Command Line Output
Traceback (most recent call last):
  File "/usr/lib64/python3.12/importlib/metadata/__init__.py", line 397, in from_name
    return next(cls.discover(name=name))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
StopIteration

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/bin/jupyter-notebook", line 33, in
sys.exit(load_entry_point('notebook==6.5.7', 'console_scripts', 'jupyter-notebook')())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/bin/jupyter-notebook", line 22, in importlib_load_entry_point
for entry_point in distribution(dist_name).entry_points
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.12/importlib/metadata/init.py", line 862, in distribution
return Distribution.from_name(distribution_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.12/importlib/metadata/init.py", line 399, in from_name
raise PackageNotFoundError(name)
importlib.metadata.PackageNotFoundError: No package metadata was found for notebook

@Geremia Geremia added bug status:Needs Triage Applied to issues that need triage labels Dec 17, 2024
@Geremia Geremia changed the title No package metadata was found for notebook Distribution name unknown → No package metadata was found for notebook Dec 17, 2024
@krassowski
Copy link
Member

This would seem like notebook package is not installed, but you have an old /usr/bin/jupyter-notebook script for launching it?

@Geremia
Copy link
Author

Geremia commented Dec 21, 2024

@krassowski
🆗, yes, I had an old /usr/bin/jupyter-notebook lying around.

I identified that the real issue is this (which I get trying to build notebook 7.3.2):

* Building sdist...
INFO:hatch_jupyter_builder.utils:Running jupyter-builder
INFO:hatch_jupyter_builder.utils:Building with hatch_jupyter_builder.npm_builder
INFO:hatch_jupyter_builder.utils:With kwargs: {'build_cmd': 'build:prod', 'source_dir': 'packages', 'build_dir': 'notebook/static', 'npm': ['jlpm']}
Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
    main()
  File "/usr/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 373, in main
    json_out["return_val"] = hook(**hook_input["kwargs"])
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 335, in build_sdist
    return backend.build_sdist(sdist_directory, config_settings)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/hatchling/build.py", line 34, in build_sdist
    return os.path.basename(next(builder.build(directory=sdist_directory, versions=['standard'])))
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/hatchling/builders/plugin/interface.py", line 147, in build
    build_hook.initialize(version, build_data)
  File "/usr/lib/python3.12/site-packages/hatch_jupyter_builder/plugin.py", line 94, in initialize
    raise e
  File "/usr/lib/python3.12/site-packages/hatch_jupyter_builder/plugin.py", line 89, in initialize
    build_func(self.target_name, version, **build_kwargs)
  File "/usr/lib/python3.12/site-packages/hatch_jupyter_builder/utils.py", line 106, in npm_builder
    npm_cmd = normalize_cmd(npm)
              ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/hatch_jupyter_builder/utils.py", line 210, in normalize_cmd
    raise ValueError(msg)
ValueError: Aborting. Could not find cmd (jlpm) in path. If command is not expected to be in user's path, use an absolute path.

ERROR Backend subprocess exited when trying to invoke build_sdist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug status:Needs Triage Applied to issues that need triage
Projects
None yet
Development

No branches or pull requests

2 participants