question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

setuptools-34.0 fails with 'ImportError: No module named packaging.version'

See original GitHub issue

Upgrading to setuptools-34.0 fails with ImportError: No module named packaging.version:

pip --version
pip 1.4.1 from /usr/lib/python2.6/site-packages (python 2.6)
---- Begin output of /usr/bin/pip install  --upgrade setuptools ----
STDOUT: Downloading/unpacking setuptools from https://pypi.python.org/packages/4f/5d/77ab299135d7a882fff2970b45c6a77d7d79db0363c395081770632e6f1d/setuptools-34.0.0.zip#md5=927ea526582deefbf98779b2c302dd3d
  Running setup.py egg_info for package setuptools
    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

CentOS 6 in AWS.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:38 (6 by maintainers)

github_iconTop GitHub Comments

128reactions
davidavdavcommented, Feb 3, 2017

@rampageservices referenced method worked for me, for a clean debian-8 (jessie) install in a Vagrant VM. For those like me at python2.7:

sudo -i
apt-get purge -y python-pip
wget https://bootstrap.pypa.io/get-pip.py
python ./get-pip.py
apt-get install python-pip

It was the only one of all suggestions I could find that actually did the job. Thanks!

63reactions
realmhamdycommented, Jan 25, 2017

I’m unable to pip anything now because of this error. It occurred when I updated my Ubuntu trusty: Not pip --version

vagrant@vagrant-ubuntu-trusty-32:~/$ pip --version
Traceback (most recent call last):
  File "/usr/bin/pip", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 70, in <module>
    import packaging.version
ImportError: No module named packaging.version

And of course not pip install:

vagrant@vagrant-ubuntu-trusty-32:~/$ pip install packaging
Traceback (most recent call last):
  File "/usr/bin/pip", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 70, in <module>
    import packaging.version
ImportError: No module named packaging.version

easy_install doesn’t work either with the same error. what should I do?

Read more comments on GitHub >

github_iconTop Results From Across the Web

ImportError: No module named packaging.version
I encountered this error on macOS after upgrading to High Sierra and re-installing MacPorts. Nothing worked until I tried this. – John Laudun....
Read more >
Setuptools 34 has been released and breaks with older versions of ...
ImportError : No module named appdirs. and ImportError: No module named packaging.version. Upgrading pip as part of the CI job appears to have...
Read more >
no module named packaging.version - pip - Ask Ubuntu
I solved the above problem by installing pip by the following command python -m pip install -U pip. Now pip is working fine.....
Read more >
from packaging import version as pack_version ImportError
Dears, I am running a python code that generates for me this error : from packaging import version as pack_version ImportError: No module...
Read more >
Bug #1658844 “most recent version does not install /usr/local ...
The failure to install the subdirs caused "ImportError: No module named packaging.version" To correct copied missing subdirs from an install ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found