executablebooks / sphinx-tabs

Tabbed views for Sphinx
https://sphinx-tabs.readthedocs.io
MIT License
263 stars 67 forks source link

Could not import extension sphinx_tabs.tabs (exception: No module named 'pkg_resources') #187

Open alexander-schranz opened 7 months ago

alexander-schranz commented 7 months ago

Describe the bug

context

Sphinx build: https://github.com/schranz-search/schranz-search/actions/runs/7226815693/job/19693182370

Could not import extension sphinx_tabs.tabs (exception: No module named 'pkg_resources')

expectation

No error.

bug But instead ___ happens

Here's an error message I ran into...

Run sphinx-build docs docs/_build
  sphinx-build docs docs/_build
  shell: /usr/bin/bash -e {0}
  env:
    pythonLocation: /opt/hostedtoolcache/Python/3.12.1/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.12.1/x64/lib
Running Sphinx v6.2.1

Extension error:
Could not import extension sphinx_tabs.tabs (exception: No module named 'pkg_resources')

problem

I think the problem is not related to sphinx tabs itself just about changes in the python ecosystem. But I don't know how to solve it. The issue appeared this week in my project, last build was 2023-11-23 (Python 3.12.0), maybe somebody has a hint what changed and make now the sphinx tabs crashing. Maybe it has todo with Python 3.12.1 release but not sure.

Reproduce the bug

Build steps are here: https://github.com/schranz-search/schranz-search/blob/0eef487d609d5e47e05b80cc6c5d060148b1fb56/.github/workflows/docs.yml#L28

List your environment

Not sure about this.

welcome[bot] commented 7 months ago

Thanks for opening your first issue here! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
Welcome to the EBP community! :tada:

foster999 commented 6 months ago

@alexander-schranz please could you update to the latest version, e.g. using pip install -U sphinx-tabs? We no longer depend on pkg_resources so this should sort the error

foster999 commented 6 months ago

Failing that, it looks like Python 12 no longer includes setuptools. So pip install setuptools might help.

If others also find this is the case, we might need to include setuptools as a dependency to support Python 12 properly

alexander-schranz commented 6 months ago

@foster999 in my case require setuptools did fix it: https://github.com/schranz-search/schranz-search/blob/0.3/docs/requirements.txt