0

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.

muru
  • 197,895
  • 55
  • 485
  • 740
  • I strongly recommend using anaconda. In addition to providing python and pip it provides pre-built versions of many packages and virtual environment management. Simply install anaconda, create a virtual environment with the desired python version and then use pip as usual. I realize this does not answer your question but I hope it will help you get around the issue – Ivaylo Strandjev Mar 03 '17 at 10:10

2 Answers2

1

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

python -m pip install -U pip

Now pip is working fine..

jkoop
  • 59
  • 6
0

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 https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py