setuptools: setuptools-34.0 fails with 'ImportError: No module named packaging.version'
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.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 38 (6 by maintainers)
Links to this issue
Commits related to this issue
- Pin version of setuptools Forces explicit version of setuptools to be used because of an upstream change: https://github.com/pypa/setuptools/issues/937 Change-Id: I4124dedee38713ca1bfa445944d8d79cf1... — committed to opnfv/storperf by deleted user 7 years ago
- BUG: pip bug, fix from https://github.com/pypa/setuptools/issues/937#issuecomment-275200042 — committed to nextml/NEXT by deleted user 7 years ago
- Adding workaround for pip error See https://github.com/pypa/setuptools/issues/937 for more details. — committed to dit4c/dockerfile-dit4c-container-ipython by tjdett 7 years ago
- Update hass_rpi_installer.sh added undocumented setup tools deps for workaround. will need to refactor to align with pypa's updates (https://github.com/pypa/setuptools/issues/937) — committed to home-assistant/fabric-home-assistant by deleted user 7 years ago
- gitlab-ci: workaround "ImportError: No module named 'packaging'" https://github.com/pypa/setuptools/issues/937 fdroid/ci-images#1 — committed to f-droid/fdroidserver by eighthave 7 years ago
- Update pip in DLRN venv Newer versions of setuptools require an updated pip to be installed. Running the --delorean-setup locally is actually failing for me with (not sure what the difference is comp... — committed to slagle/tripleo-ci by slagle 7 years ago
- Update pip in DLRN venv Newer versions of setuptools require an updated pip to be installed. Running the --delorean-setup locally is actually failing for me with (not sure what the difference is comp... — committed to slagle/tripleo-ci by slagle 7 years ago
- Update pip in DLRN venv Newer versions of setuptools require an updated pip to be installed. Running the --delorean-setup locally is actually failing for me with (not sure what the difference is comp... — committed to slagle/tripleo-ci by slagle 7 years ago
- Update pip in DLRN venv Newer versions of setuptools require an updated pip to be installed. Running the --delorean-setup locally is actually failing for me with (not sure what the difference is comp... — committed to slagle/tripleo-ci by slagle 7 years ago
- Update pip in DLRN venv Newer versions of setuptools require an updated pip to be installed. Running the --delorean-setup locally is actually failing for me with (not sure what the difference is comp... — committed to slagle/tripleo-ci by slagle 7 years ago
- Update pip in DLRN venv Newer versions of setuptools require an updated pip to be installed. Running the --delorean-setup locally is actually failing for me with (not sure what the difference is comp... — committed to slagle/tripleo-ci by slagle 7 years ago
- Update pip in DLRN venv Newer versions of setuptools require an updated pip to be installed. Running the --delorean-setup locally is actually failing for me with (not sure what the difference is comp... — committed to slagle/tripleo-ci by slagle 7 years ago
- Update pip in DLRN venv Newer versions of setuptools require an updated pip to be installed. Running the --delorean-setup locally is actually failing for me with (not sure what the difference is comp... — committed to slagle/tripleo-ci by slagle 7 years ago
- Update pip in DLRN venv Newer versions of setuptools require an updated pip to be installed. Running the --delorean-setup locally is actually failing for me with (not sure what the difference is comp... — committed to slagle/tripleo-ci by slagle 7 years ago
- Update pip in DLRN venv Newer versions of setuptools require an updated pip to be installed. Running the --delorean-setup locally is actually failing for me with (not sure what the difference is comp... — committed to slagle/tripleo-ci by slagle 7 years ago
- Update pip in DLRN venv Newer versions of setuptools require an updated pip to be installed. Running the --delorean-setup locally is actually failing for me with (not sure what the difference is comp... — committed to slagle/tripleo-ci by slagle 7 years ago
- Updated openstack/openstack Project: openstack-infra/tripleo-ci 3aaf3fb2a559d39679dc2fd0d1fd2dd108b5c9a9 Update pip in DLRN venv Newer versions of setuptools require an updated pip to be installed.... — committed to openstack/openstack by slagle 7 years ago
- Update pip in DLRN venv Newer versions of setuptools require an updated pip to be installed. Running the --delorean-setup locally is actually failing for me with (not sure what the difference is comp... — committed to openstack/tripleo-ci by slagle 7 years ago
- Fix CentOS 6 Travis CI tests See https://github.com/pypa/setuptools/issues/937 Signed-off-by: Tim Waugh <twaugh@redhat.com> — committed to containerbuildsystem/osbs-client by twaugh 6 years ago
- Fix CentOS 6 Travis CI tests See https://github.com/pypa/setuptools/issues/937 Signed-off-by: Tim Waugh <twaugh@redhat.com> — committed to containerbuildsystem/koji-containerbuild by twaugh 6 years ago
@rampageservices referenced method worked for me, for a clean debian-8 (jessie) install in a Vagrant VM. For those like me at python2.7:
It was the only one of all suggestions I could find that actually did the job. Thanks!
I’m unable to pip anything now because of this error. It occurred when I updated my Ubuntu trusty: Not
pip --version
And of course not pip install:
easy_install doesn’t work either with the same error. what should I do?
You can reinstall pip using get-pip.py as @lambda-conjecture suggested. You may also be able to reinstall it with
python -m pip install -U pip
.Just ran into this - fixed pip by re-installing pip via the get-pip.py method described here: https://packaging.python.org/installing/#install-pip-setuptools-and-wheel
still, something seems wrong to me when I’m blindly running into this. without warning, dependency fail or similar. I think it might be good for users to be aware and informed about the need to upgrade to latest pip as a dependency for v34
+1 under ubuntu14.04
On my side i checked for the issues using following command
pip check
it showed the following errors
then i fixed the said error by installing the dependicies using following command
pip install appdirs packaging
and this fixes my problem. Hope it will help.
Upgrading PIP seems to have fixed it:
I had the same same issue when I was trying to do a
sudo pip install cryptography
Error Message:
Running
sudo pip install -U setuptools
and thensudo pip install cryptography
solved my issue.Hope this helps !
Thanks @jaraco. I’m using 14.04, I wonder if that just doesn’t have the updated packages.
Since I am using ansible, I was able to solve my problem by adding a task before my virtualenv installation which is to first pip install
setuptools==33.1.1
. Then all my other pip install tasks seem to work.And this is even when I get it to install six! But I wonder if the current install of “six” doesn’t take effect because the whole pip install is cancelled because of the error?
edit: Progress! Installing “six” beforehand on its own actually solves the issue, strangely enough. It looks like initially it downloads the wheel file, but then for some reason it falls back to the setup.py install route, which then fails because six isn’t there. I wonder why it does that?