No module named packaging

Posted on Mar 31, 2022

Question

I work on Ubuntu 14. I install python3 and pip3. When I try to use pip3, I have this error

Traceback (most recent call last):
  File "/usr/local/bin/pip3", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/usr/local/lib/python3.5/dist-packages/pkg_resources/__init__.py", line 70, i
n <module>
    import packaging.version
ImportError: No module named 'packaging'

Does anyone know what is the issue?

Answer

First update your pip version itself. You can take a look at this answer

pip3 install --upgrade pip

And then try to install packaging, if its not already installed by now.

pip3 install packaging