Getting AttributeError: module ‘collections’ has no attribute ‘MutableMapping’ while using any pip3 command on linux Python 3.10

We Are Going To Discuss About Getting AttributeError: module ‘collections’ has no attribute ‘MutableMapping’ while using any pip3 command on linux Python 3.10. So lets Start this Python Article.

Getting AttributeError: module ‘collections’ has no attribute ‘MutableMapping’ while using any pip3 command on linux Python 3.10

  1. How to solve Getting AttributeError: module 'collections' has no attribute 'MutableMapping' while using any pip3 command on linux Python 3.10

    The problem is caused by an old version of pyparsing that has been vendored into pkg_resources, which is now part of setuptools.
    I think if you install an updated setuptools, things will run better:
    python -m pip install -U setuptools
    EDIT – After installing my own version of 3.10.1 on Ubuntu 18.04, I am having this same issue. And the broken pkg_resources is preventing doing any updates, so your classic Catch-22. To begin chasing down a resolution, I've submitted a ticket on the setuptools Github repo.
    EDIT2 – Based on aid on the setuptools GitHub repo, I did the following steps:
    # add deadsnake repo (default or nightly) sudo add-apt-repository ppa:deadsnakes/ppa sudo apt install python3.10 git clone https://github.com/pypa/setuptools.git && cd setuptools && sudo python3.10 setup.py install sudo apt install python3.10-distutils curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10 sudo apt install python3.10-venv
    At this point, I am able to run pip in Python3.10, and create venvs using python3.10 -m venv virtualenv-dir.

  2. Getting AttributeError: module 'collections' has no attribute 'MutableMapping' while using any pip3 command on linux Python 3.10

    The problem is caused by an old version of pyparsing that has been vendored into pkg_resources, which is now part of setuptools.
    I think if you install an updated setuptools, things will run better:
    python -m pip install -U setuptools
    EDIT – After installing my own version of 3.10.1 on Ubuntu 18.04, I am having this same issue. And the broken pkg_resources is preventing doing any updates, so your classic Catch-22. To begin chasing down a resolution, I've submitted a ticket on the setuptools Github repo.
    EDIT2 – Based on aid on the setuptools GitHub repo, I did the following steps:
    # add deadsnake repo (default or nightly) sudo add-apt-repository ppa:deadsnakes/ppa sudo apt install python3.10 git clone https://github.com/pypa/setuptools.git && cd setuptools && sudo python3.10 setup.py install sudo apt install python3.10-distutils curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10 sudo apt install python3.10-venv
    At this point, I am able to run pip in Python3.10, and create venvs using python3.10 -m venv virtualenv-dir.

Solution 1

The problem is caused by an old version of pyparsing that has been vendored into pkg_resources, which is now part of setuptools.

I think if you install an updated setuptools, things will run better:

python -m pip install -U setuptools

EDIT – After installing my own version of 3.10.1 on Ubuntu 18.04, I am having this same issue. And the broken pkg_resources is preventing doing any updates, so your classic Catch-22. To begin chasing down a resolution, I’ve submitted a ticket on the setuptools Github repo.

EDIT2 – Based on aid on the setuptools GitHub repo, I did the following steps:

# add deadsnake repo (default or nightly)
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt install python3.10
git clone https://github.com/pypa/setuptools.git && cd setuptools && sudo python3.10 setup.py install
sudo apt install python3.10-distutils
curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10
sudo apt install python3.10-venv

At this point, I am able to run pip in Python3.10, and create venvs using python3.10 -m venv virtualenv-dir.

Original Author PaulMcG Of This Content

Solution 2

I can try to fix it with pip install request --upgrade

Original Author KeeVx Of This Content

Solution 3

update pip using code bellow

curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10

Original Author Daniel Braun Of This Content

Solution 4

Update pip…collections.MutableMapping has become collections.abc.MutableMapping.

Original Author Kelly Of This Content

Conclusion

So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.

Also Read,

ittutorial team

I am an Information Technology Engineer. I have Completed my MCA And I have 4 Year Plus Experience, I am a web developer with knowledge of multiple back-end platforms Like PHP, Node.js, Python and frontend JavaScript frameworks Like Angular, React, and Vue.

Leave a Comment