Unable to install sphinx with Python 3.10

Conda create doesn’t find a solution for

conda create -n sphinx4 "sphinx>4" "python=3.10"

I’m using miniconda 4.12.0 on Linux with the Anaconda main repo (tried both repo.anaconda.cloud and repo.anaconda.com).

Error message:

Package python conflicts for:
sphinx[version='>4'] -> python[version='>=3.6']
sphinx[version='>4'] -> alabaster[version='>=0.7,<0.8'] -> python[version='>=2.7,<2.8.0a0|>=3.6,<3.7.0a0|>=3.7,<3.8.0a0|>=3.5,<3.6.0a0|>=3.8,<3.9.0a0|>=3.9,<3.10.0a0|>=3.4|>=3.10,<3.11.0a0|>=3.5']
python=3.10The following specifications were found to be incompatible with your system:

  - feature:/linux-64::__glibc==2.27=0
  - python=3.10 -> libgcc-ng[version='>=7.5.0'] -> __glibc[version='>=2.17']

Your installed version is: 2.27

When I don’t constrain sphinx, the solver selects sphinx=3.5.3, which is incompatible with Python 3.10:

conda create -n sphinx_in_py310 sphinx python=3.10 
conda activate sphinx_in_py310
python -c "import sphinx.util.typing"

Traceback (most recent call last):
...
File "/home/user/miniconda3/envs/sphinx_in_py310/lib/python3.10/site-packages/sphinx/util/typing.py", line 34, in <module>
    from types import Union as types_Union
ImportError: cannot import name 'Union' from 'types' (/home/user/miniconda3/envs/sphinx_in_py310/lib/python3.10/types.py)

I assume the problems both need to get fixed in the repo, but is there something I can do to get sphinx in combination Python 3.10 (additional version requirements for conda install)?

[Edit]
The reason for the solver not finding a solution is docutils not being available in other versions than 0.18.1 for Python 3.10 (sphinx 4.4.0 requires docutils >=0.14,<0.18).
My current workaround is a local channel containing a self-built package of docutils 0.17.1 for Python 3.10.

What can I do to get docutils=0.17.1 for Python 3.10 into the official main channel?

1 Like