most recent version does not install /usr/local/lib/python2.7/dist-packages/pkg_resources/extern and /_vendor

Bug #1658844 reported by bill danford on 2017-01-24
122
This bug affects 23 people
Affects Status Importance Assigned to Milestone
python-pip (Ubuntu)
Undecided
Unassigned

Bug Description

This is new install of lubuntu 14.04, installing python-pip
Most recent python-pip version, installed 23 Jan 2017, does not install /usr/local/lib/python2.7/dist-packages/pkg_resources/extern and /usr/local/lib/python2.7/dist-packages/pkg_resources//_vendor.
The failure to install the subdirs caused "ImportError: No module named packaging.version"
To correct copied missing subdirs from an install done about a week ago.
Also apparent issues in /usr/local/lib/python2.7/dist-packages/setuptools and/or /usr/local/lib/python2.7/dist-packages/setuptools-34.0.1.dist-info
To correct copied from an install done about a week ago.
I note earlier install had /usr/local/lib/python2.7/dist-packages/setuptools-33.1.1.dist-info
This revision from 33.1.1 to 34.0.2 seems to be related to the issue.
Specific problem came about installing cryptography: sudo pip install cryptography --force-reinstall
Cryptography needed for paramiko package.

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: python-pip 1.5.4-1ubuntu4
ProcVersionSignature: Ubuntu 4.4.0-59.80~14.04.1-generic 4.4.35
Uname: Linux 4.4.0-59-generic i686
ApportVersion: 2.14.1-0ubuntu3.23
Architecture: i386
CurrentDesktop: LXDE
Date: Mon Jan 23 18:30:33 2017
PackageArchitecture: all
SourcePackage: python-pip
UpgradeStatus: No upgrade log present (probably fresh install)

bill danford (w-danford) wrote :
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in python-pip (Ubuntu):
status: New → Confirmed
eric (hongkongrr) wrote :

Yes this is also effecting me too and blocking my auto deploy projects across the board.

Mateusz Misiorny (soquel) wrote :

I am experiencing the same issue as well. Are there any known workarounds for now, before it's fixed?

Carlos Vasquez (cvasquez-py) wrote :

Same issue here with our Chef builds.

       ---- Begin output of /usr/bin/pip install cryptography ----
       STDOUT:
       STDERR: 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
       ---- End output of /usr/bin/pip install cryptography ----
       Ran /usr/bin/pip install cryptography returned 1
       [2017-01-25T09:04:40+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

Dan Erklauer (derklauer) wrote :

Is there a work around for this?

Yitzchak Lockerman (ylockerman) wrote :

This issue is breaking our puppet configuration scripts. Breaking pip can lead to some serious problems, I hope this is considered a critical bug.

Kyle Corupe (kyle-corupe) wrote :

+1 for experiencing the issue and breaking our builds.

Has anyone figured out a way around this bug? Haven't been able to deploy since.

Chris Downs (cdowns) wrote :

This isn't a good workaround for most people I'm sure, but I upgraded to 16.04 which doesn't have the issue. The specific app I'm hitting this bug with is a Python app in a Docker container so it's pretty easy to just rebuild my image against 16.04. I'll be downgrading once this is fixed though.

Kyle Corupe (kyle-corupe) wrote :

Found a work-around (https://github.com/pypa/setuptools/issues/937)

Install pip from python not packages and then setuptools from pip.

python -m pip install -U pip
pip install -U pip setuptools

When using the new pip its located in /usr/local/bin/pip

eric (hongkongrr) wrote :

The workaround doesn't work for my auto build environments, it would be good if we can get an official fix still.

Dan Erklauer (derklauer) wrote :

I believe I figured out the problem. When spinning up a fresh ubuntu 14.04 vagrant machine and manually installing pip with sudo apt-get install python-pip the dependency pkg_resources is installed with python3-pkg-resources to. I experience the same results if I use a ubuntu 14.04 image in an oracle VM. The workaround is to install pip with easy_install via python-setuptools and pip will work.

Luca Giovenzana (lucagiove) wrote :

In [1]: import setuptools
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-b6e7bae96787> in <module>()
----> 1 import setuptools

/usr/lib/python2.7/dist-packages/setuptools/__init__.pyc in <module>()
     10
     11 import setuptools.version
---> 12 from setuptools.extension import Extension
     13 from setuptools.dist import Distribution, Feature, _get_unpatched
     14 from setuptools.depends import Require

/usr/lib/python2.7/dist-packages/setuptools/extension.py in <module>()
      5 import distutils.extension
      6
----> 7 from setuptools.dist import _get_unpatched
      8
      9 _Extension = _get_unpatched(distutils.core.Extension)

/usr/lib/python2.7/dist-packages/setuptools/dist.py in <module>()
     14 from setuptools.depends import Require
     15 from setuptools.compat import numeric_types, basestring
---> 16 import pkg_resources
     17
     18 def _get_unpatched(cls):

/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py in <module>()
     68 importlib_machinery = None
     69
---> 70 import packaging.version
     71 import packaging.specifiers
     72 import packaging.requirements

ImportError: No module named packaging.version

Barry Warsaw (barry) wrote :

Something from the description is confusing me:

"""
This is new install of lubuntu 14.04, installing python-pip
Most recent python-pip version, installed 23 Jan 2017, does not install /usr/local/lib/python2.7/dist-packages/pkg_resources/extern and /usr/local/lib/python2.7/dist-packages/pkg_resources//_vendor.
"""

Note the /usr/local paths. While these paths are on Ubuntu python's sys.path by default, installing things from PyPI into these locations with `sudo pip install` can very definitely interfere with system packages like pip. We do not recommend `sudo pip install` but instead `pip install --user` which will put things in your ~/.local directory. That should reduce or eliminate the conflicts.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.