Importerror: Cannot Import Name 'Sequence' from 'Collections' (/Usr/Lib/Python3.10/Collections/__Init__. Py)
I'm Getting This Error in the Jenkins Build Site Stage When I'm Trying to Raise a Pr, Can Anyone Please Help Me Resolve This Error? Thanks in Advance. Build...
I'm getting this error in the Jenkins build site stage when I'm trying to raise a pr, can anyone please help me resolve this error? Thanks in advance.
Build site
mkdocs build
— Shell Script
<1s
[2022-08-24T17:43:51.923Z] + mkdocs build
[2022-08-24T17:43:52.182Z] Traceback (most recent call last):
[2022-08-24T17:43:52.182Z] File "/usr/local/bin/mkdocs", line 5, in <module>
[2022-08-24T17:43:52.182Z] from mkdocs.__main__ import cli
[2022-08-24T17:43:52.182Z] File "/usr/local/lib/python3.10/dist-packages/mkdocs/__main__.py", line 14, in <module>
[2022-08-24T17:43:52.182Z] from mkdocs import config
[2022-08-24T17:43:52.182Z] File "/usr/local/lib/python3.10/dist-packages/mkdocs/config/__init__.py", line 2, in <module>
[2022-08-24T17:43:52.182Z] from mkdocs.config.defaults import DEFAULT_SCHEMA
[2022-08-24T17:43:52.182Z] File "/usr/local/lib/python3.10/dist-packages/mkdocs/config/defaults.py", line 4, in <module>
[2022-08-24T17:43:52.182Z] from mkdocs.config import config_options
[2022-08-24T17:43:52.182Z] File "/usr/local/lib/python3.10/dist-packages/mkdocs/config/config_options.py", line 5, in <module>
[2022-08-24T17:43:52.182Z] from collections import Sequence, namedtuple
[2022-08-24T17:43:52.182Z] ImportError: cannot import name 'Sequence' from 'collections' (/usr/lib/python3.10/collections/__init__.py)
script returned exit code 1
1 Answer
With Python 3.10 Sequence has been moved to collections.abc.
Seems like you're using a very old version of mkdocs (from Oct. 2020+). Please consider updating mkdocs with pip install -U mkdocs.