Recently, I face ImportError: No module named packaging.version and I would like to share knowledge to fix that problem.
Terminal:
pip --version
pip 1.5.4 from /usr/lib/python2.7/dist-packages (python 2.7)
I am trying to upgrade pip
python -m pip install -U pip
Traceback (most recent call last):
File "<string>", line 3, in <module>
File "setuptools/__init__.py", line 12, in <module>
import setuptools.version
File "setuptools/version.py", line 1, in <module>
import pkg_resources
File "pkg_resources/__init__.py", line 70, in <module>
import packaging.version
ImportError: No module named packaging.version
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 3, in <module>
File "setuptools/__init__.py", line 12, in <module>
import setuptools.version
File "setuptools/version.py", line 1, in <module>
import pkg_resources
File "pkg_resources/__init__.py", line 70, in <module>
import packaging.version
ImportError: No module named packaging.version
Solution:
sudo su root
apt-get purge -y python-pip
wget https://bootstrap.pypa.io/get-pip.py
python ./get-pip.py
apt-get install python-pip
Terminal:
pip --version
pip 1.5.4 from /usr/lib/python2.7/dist-packages (python 2.7)
I am trying to upgrade pip
python -m pip install -U pip
Traceback (most recent call last):
File "<string>", line 3, in <module>
File "setuptools/__init__.py", line 12, in <module>
import setuptools.version
File "setuptools/version.py", line 1, in <module>
import pkg_resources
File "pkg_resources/__init__.py", line 70, in <module>
import packaging.version
ImportError: No module named packaging.version
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 3, in <module>
File "setuptools/__init__.py", line 12, in <module>
import setuptools.version
File "setuptools/version.py", line 1, in <module>
import pkg_resources
File "pkg_resources/__init__.py", line 70, in <module>
import packaging.version
ImportError: No module named packaging.version
Solution:
sudo su root
apt-get purge -y python-pip
wget https://bootstrap.pypa.io/get-pip.py
python ./get-pip.py
apt-get install python-pip
Thanks a bunch !
ReplyDeleteCheers..
DeleteThanks, this helped with my pip install on Debian 8 in order to run Jupyter.
ReplyDeleteThat's great to know. Cheers..
Deletethank you!!
ReplyDeleteThanks a lot. It works for pip3 too.
ReplyDeleteJust change the following:
apt-get purge -y python3-pip
wget https://bootstrap.pypa.io/get-pip.py
python3 ./get-pip.py
apt-get install python3-pip
That's awesome. Appreciate your comment. Cheers.
Deletethanks!
DeleteThanks a lot........
ReplyDeleteTHANKS!
ReplyDeleteThanks a ton :)
ReplyDeleteThanks a lot bro.. you saved my life
ReplyDeletereally thanks !
ReplyDelete