title: AttributeError: module 'collections' has no attribute 'MutableMapping'
body: <p>I recently installed python3.10 on my ubuntu system and I believe I made a link from <code>/usr/bin/python3</code> to <code>/usr/bin/python3.10</code></p>
  <p>If I run <code>python --version</code> I get <code>Python 2.7.17</code> and if I run <code>python3 --version</code> I get <code>Python 3.10.2</code></p>
  <p>I believe something I did broke something in my global python / pip.</p>
  <p>Whenever I try to use pip globally I get this error:</p>
  <pre><code>Traceback (most recent call last):
    File &quot;/usr/local/bin/pip&quot;, line 7, in &lt;module&gt;
      from pip._internal.cli.main import main
    File &quot;/usr/lib/python3/dist-packages/pip/__init__.py&quot;, line 22, in &lt;module&gt;
      from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning
    File &quot;/usr/lib/python3/dist-packages/pip/_vendor/__init__.py&quot;, line 73, in &lt;module&gt;
      vendored(&quot;pkg_resources&quot;)
    File &quot;/usr/lib/python3/dist-packages/pip/_vendor/__init__.py&quot;, line 33, in vendored
      __import__(modulename, globals(), locals(), level=0)
    File &quot;/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/__init__.py&quot;, line 77, in &lt;module&gt;
    File &quot;/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/_vendor/packaging/requirements.py&quot;, line 9, in &lt;module&gt;
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1027, in _find_and_load
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1006, in _find_and_load_unlocked
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 672, in _load_unlocked
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 632, in _load_backward_compatible
    File &quot;/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/extern/__init__.py&quot;, line 43, in load_module
    File &quot;/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/_vendor/pyparsing.py&quot;, line 943, in &lt;module&gt;
  AttributeError: module 'collections' has no attribute 'MutableMapping'
  </code></pre>
  <p>After googling I thought the issue is that my pip was made using an older version of python I had so I tried to run:</p>
  <pre><code>sudo apt remove python-pip python3-pip
  sudo apt install python-pip python3-pip
  </code></pre>
  <p>but even after this I still get the same error with pip.</p>
  <p>I do have a virtualenv that I was using with a django project (that uses python 3.10) and if I source into that I am able to use the pip there, but I think this just shows the pip in that venv is properly configured</p>
  <p>Result of running <code>ls -la /usr/bin/ | grep -i</code>:</p>
  <pre><code>brick@nextgearserver:/etc/apache2$ ls -la /usr/bin/ | grep -i &quot;pip\|python&quot;
  lrwxrwxrwx  1 root   root          26 Mar 26  2018 dh_pypy -&gt; ../share/dh-python/dh_pypy
  -rwxr-xr-x  1 root   root        1056 Apr 16  2018 dh_python2
  lrwxrwxrwx  1 root   root          29 Mar 26  2018 dh_python3 -&gt; ../share/dh-python/dh_python3
  lrwxrwxrwx  1 root   root          13 Dec  7  2018 lesspipe -&gt; /bin/lesspipe
  lrwxrwxrwx  1 root   root          23 Feb 27  2021 pdb2.7 -&gt; ../lib/python2.7/pdb.py
  lrwxrwxrwx  1 root   root          24 Jan 15 13:03 pdb3.10 -&gt; ../lib/python3.10/pdb.py
  lrwxrwxrwx  1 root   root          23 Dec  8 16:08 pdb3.6 -&gt; ../lib/python3.6/pdb.py
  -rwxr-xr-x  1 root   root         292 Apr 30  2021 pip
  -rwxr-xr-x  1 root   root         292 Apr 30  2021 pip2
  -rwxr-xr-x  1 root   root         293 Apr 30  2021 pip3
  lrwxrwxrwx  1 root   root          31 Oct 25  2018 py3versions -&gt; ../share/python3/py3versions.py
  lrwxrwxrwx  1 root   root          26 Mar 26  2018 pybuild -&gt; ../share/dh-python/pybuild
  lrwxrwxrwx  1 root   root           9 Apr 16  2018 python -&gt; python2.7
  lrwxrwxrwx  1 root   root           9 Apr 16  2018 python2 -&gt; python2.7
  -rwxr-xr-x  1 root   root     3633000 Feb 27  2021 python2.7
  lrwxrwxrwx  1 root   root          33 Feb 27  2021 python2.7-config -&gt; x86_64-linux-gnu-python2.7-config
  lrwxrwxrwx  1 root   root          16 Apr 16  2018 python2-config -&gt; python2.7-config
  lrwxrwxrwx  1 root   root          19 Jan 30 15:07 python3 -&gt; /usr/bin/python3.10
  -rwxr-xr-x  1 root   root     5515256 Jan 15 13:03 python3.10
  -rwxr-xr-x  2 root   root     4526456 Dec  8 16:08 python3.6
  lrwxrwxrwx  1 root   root          33 Dec  8 16:08 python3.6-config -&gt; x86_64-linux-gnu-python3.6-config
  -rwxr-xr-x  2 root   root     4526456 Dec  8 16:08 python3.6m
  lrwxrwxrwx  1 root   root          34 Dec  8 16:08 python3.6m-config -&gt; x86_64-linux-gnu-python3.6m-config
  lrwxrwxrwx  1 root   root          16 Oct 25  2018 python3-config -&gt; python3.6-config
  -rwxr-xr-x  1 root   root         384 Feb  5  2018 python3-futurize
  lrwxrwxrwx  1 root   root          10 Oct 25  2018 python3m -&gt; python3.6m
  lrwxrwxrwx  1 root   root          17 Oct 25  2018 python3m-config -&gt; python3.6m-config
  -rwxr-xr-x  1 root   root         388 Feb  5  2018 python3-pasteurize
  -rwxr-xr-x  1 root   root         152 Nov 11  2017 python3-pbr
  lrwxrwxrwx  1 root   root          16 Apr 16  2018 python-config -&gt; python2.7-config
  lrwxrwxrwx  1 root   root          29 Apr 16  2018 pyversions -&gt; ../share/python/pyversions.py
  -rwxr-xr-x  1 root   root        2971 Feb 27  2021 x86_64-linux-gnu-python2.7-config
  -rwxr-xr-x  1 root   root        3246 Jan 15 13:03 x86_64-linux-gnu-python3.10-config
  lrwxrwxrwx  1 root   root          34 Dec  8 16:08 x86_64-linux-gnu-python3.6-config -&gt; x86_64-linux-gnu-python3.6m-config
  -rwxr-xr-x  1 root   root        3283 Dec  8 16:08 x86_64-linux-gnu-python3.6m-config
  lrwxrwxrwx  1 root   root          33 Oct 25  2018 x86_64-linux-gnu-python3-config -&gt; x86_64-linux-gnu-python3.6-config
  lrwxrwxrwx  1 root   root          34 Oct 25  2018 x86_64-linux-gnu-python3m-config -&gt; x86_64-linux-gnu-python3.6m-config
  lrwxrwxrwx  1 root   root          33 Apr 16  2018 x86_64-linux-gnu-python-config -&gt; x86_64-linux-gnu
  python2.7-config
  </code></pre>