Closed anntzer closed 2 years ago
Python 3.10 finally made this breaking change. sphinxcontrib.napoleon
now breaks on Python 3.10 (in a sphinx build script) with:
Could not import extension sphinxcontrib.napoleon (exception: cannot import name 'Callable' from 'collections' (/usr/local/lib/python3.10/collections/__init__.py))
Should be fixed in #36
Closed by #36, afaict.
Hi there
has this change been released yet ?
[apssh] sphinx (devel $=) $ python -c 'import sphinxcontrib.napoleon'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/tparment/miniconda3/envs/apssh/lib/python3.10/site-packages/sphinxcontrib/napoleon/__init__.py", line 13, in <module>
from sphinxcontrib.napoleon.docstring import GoogleDocstring, NumpyDocstring
File "/Users/tparment/miniconda3/envs/apssh/lib/python3.10/site-packages/sphinxcontrib/napoleon/docstring.py", line 16, in <module>
from collections import Callable
ImportError: cannot import name 'Callable' from 'collections' (/Users/tparment/miniconda3/envs/apssh/lib/python3.10/collections/__init__.py)
my environment
[apssh] sphinx (devel $=) $ python --version
Python 3.10.4
[apssh] sphinx (devel $=) $ pip install -U sphinxcontrib-napoleon
Requirement already satisfied: sphinxcontrib-napoleon in /Users/tparment/miniconda3/envs/apssh/lib/python3.10/site-packages (0.7)
Requirement already satisfied: six>=1.5.2 in /Users/tparment/miniconda3/envs/apssh/lib/python3.10/site-packages (from sphinxcontrib-napoleon) (1.16.0)
Requirement already satisfied: pockets>=0.3 in /Users/tparment/miniconda3/envs/apssh/lib/python3.10/site-packages (from sphinxcontrib-napoleon) (0.9.1)
[apssh] sphinx (devel $=) $ pip show sphinxcontrib-napoleon
Name: sphinxcontrib-napoleon
Version: 0.7
Summary: Sphinx "napoleon" extension.
Home-page: https://sphinxcontrib-napoleon.readthedocs.io
Author: Rob Ruana
Author-email: rob@robruana.com
License: BSD
Location: /Users/tparment/miniconda3/envs/apssh/lib/python3.10/site-packages
Requires: pockets, six
Required-by:
+1 - just hit this issue (and have to disable napolean to use Python 3.10). Could we get an update if it's released / re-open the issue / request to make an new issue (I'd be happy to).
+1 just hit the same issue as well for python 3.10.6.
when installed from pip the #36 is not reflected.
This is fixed in prod, In your conf.py file use sphinx.exts.napolean
@Haaroon this helped
python -Wall -c 'import sphinxcontrib.napoleon'
givesApplying https://github.com/sphinx-doc/sphinx/commit/bc081e44f8b438fa1e02b17bf6c4f4ea9c91126c#diff-9030d0e02ccc211fcd348c14eb2e7488 should be enough to fix the issue.