Prashanth
Prashanth

Reputation: 1322

ImportError: No module named packaging.version

When I tried installing Flask I got this error:

ImportError: No module named packaging.version

Upvotes: 20

Views: 45710

Answers (6)

frog red
frog red

Reputation: 1

i also have the problem when i install kats module, after try install a older packaging, such as "pip install packaging==21.0", i sovled my problem. hope helpfull.

Upvotes: 0

comodin
comodin

Reputation: 11

In case anyone stumbles upon this problem, my solution was to change the packaging version from 22.0 to 21.3.

Upvotes: 1

Jordan
Jordan

Reputation: 261

As an Ubuntu 14.04 user, upgrading pip to version 9.0.1 fixed this problem for me.

Upgrading pip normally

  • Download get-pip.py script
  • Run: python get-pip.py

Upgrading/installing pip behind a corporate firewall

  • Download get-pip.py script, along with pip, wheel, and setuptools from pypi
  • Place all files in the /tmp directory
  • Run the following command to install pip: sudo -H python /tmp/get-pip.py --no-index --find-links=/tmp pip

Upvotes: 4

algometrix
algometrix

Reputation: 3992

Try this

wget https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py

Upvotes: 7

José T. Lin
José T. Lin

Reputation: 149

If your Python runs on Ubuntu, try to do this:

cd /usr/local/lib/python2.7/dist-packages
mv pkg_resources/ pkg_resources_bak/

I'm not sure what package installed the "pkg_resources", it will make pip always show error.

Upvotes: 13

Prashanth
Prashanth

Reputation: 1322

To fix this, I had to do:

pip install setuptools

Upvotes: 15

Related Questions