Skip to content

Improve error message for missing packages when installed via git URL in requirements.txt #13523

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

Open
hmedina opened this issue May 3, 2025 · 0 comments
Labels

Comments

@hmedina
Copy link

hmedina commented May 3, 2025

Describe the bug

I have a document that specifies in its requirements.txt file a git+https link to a package; this gets installed under src/. If I remove that folder (e.g. to install the package in "editable form" elsewhere), a ModuleNotFoundError error appears, however it does not specify what module is missing. I'm reporting this as "Please also report this if it was a user error, so that a better error message can be provided next time."

How to Reproduce

Assuming the requirements.txt file contains something like

pygments >= 2.7.1, < 3
Pygments_Kappa_plugin @ git+https://github.com/hmedina/Pygments_Kappa_plugin.git

The package Pygments_Kappa_plugin will get installed under src/Pygments_Kappa_plugin. If I delete that folder, make clean & make html, I get:

$ make html
Running Sphinx v8.2.3
loading translations [en]... done
making output directory... done
checking bibtex cache... out of date
parsing bibtex file /home/hmedina/project/bibliography.bib... parsed 70 entries


Versions
========

* Platform:         linux; (Linux-5.15.167.4-microsoft-standard-WSL2-x86_64-with-glibc2.39)
* Python version:   3.13.2 (CPython)
* Sphinx version:   8.2.3
* Docutils version: 0.21.2
* Jinja2 version:   3.1.6
* Pygments version: 2.19.1

Last Messages
=============

None.

Loaded Extensions
=================

None.

Traceback
=========

      File "<frozen importlib._bootstrap>", line 1324, in _find_and_load_unlocked
    ModuleNotFoundError: No module named 'core'


The full traceback has been saved in:
/tmp/sphinx-err-clglaqti.log

To report this error to the developers, please open an issue at <https://github.com/sphinx-doc/sphinx/issues/>. Thanks!
Please also report this if it was a user error, so that a better error message can be provided next time.
make: *** [Makefile:20: html] Error 2

A better error message would mention that a package, Pygments_Kappa_plugin, is now missing, instead of only mentioning core.

Environment Information

Platform:              linux; (Linux-5.15.167.4-microsoft-standard-WSL2-x86_64-with-glibc2.39)
Python version:        3.13.2 (main, Feb 12 2025, 04:07:04) [GCC 13.3.0])
Python implementation: CPython
Sphinx version:        8.2.3
Docutils version:      0.21.2
Jinja2 version:        3.1.6
Pygments version:      2.19.1

Sphinx extensions

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant