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 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.

10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Sophia Al-Mansoor

Sophia Al-Mansoor

Global Business & E-Commerce Reporter

Sophia analyzes international trade, startup ecosystems, retail transformation, and supply chain logistics for modern digital publications.

Share this article
Twitter Facebook Pinterest