No Module Named Packaging. Version

I installed Ubuntu 14.04 yesterday and installed pip by the command
sudo apt-get install python-pip,
later when I am trying to install other packages through pip or trying to check the pip version, I am getting the following error.

Traceback (most recent call last):  
  File "/usr/bin/pip", line 5, in module  
    from pkg_resources import load_entry_point  
  File "/home/abhi/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 70, in module  
    import packaging.version  
ImportError: No module named packaging.version

I tried by installing pip3, but that also gives the same error.

1

2 Answers

I solved the above problem by installing pip by the following command

python -m pip install -U pip

Now pip is working fine..

2

What worked for me was to reinstall pip using the get-pip.py script, as described here:

sudo apt-get purge python-pip python-setuptools
curl -O 
sudo python get-pip.py

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Chloe Bennett

Chloe Bennett

Culture, Media & Entertainment Columnist

Chloe Bennett explores the intersection of pop culture, streaming entertainment, digital trends, and contemporary lifestyle. Her weekly commentary reaches thousands of culture enthusiasts.

Share this article
Twitter Facebook Pinterest