pip is breaking in ppc64el

Bug #1555723 reported by Breno Leitão
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
python-cryptography (Ubuntu)
Invalid
Undecided
Barry Warsaw

Bug Description

When starting pip on Ubuntu/ppc64el 16.04, it fails with the following stack:

$ pip

Traceback (most recent call last):
  File "/usr/local/bin/pip", line 7, in <module>
    from pip import main
  File "/usr/local/lib/python2.7/dist-packages/pip/__init__.py", line 15, in <module>
    from pip.vcs import git, mercurial, subversion, bazaar # noqa
  File "/usr/local/lib/python2.7/dist-packages/pip/vcs/mercurial.py", line 10, in <module>
    from pip.download import path_to_url
  File "/usr/local/lib/python2.7/dist-packages/pip/download.py", line 38, in <module>
    from pip._vendor import requests, six
  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/__init__.py", line 53, in <module>
    from .packages.urllib3.contrib import pyopenssl
  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/contrib/pyopenssl.py", line 53, in <module>
    import OpenSSL.SSL
  File "/usr/lib/python2.7/dist-packages/OpenSSL/__init__.py", line 8, in <module>
    from OpenSSL import rand, crypto, SSL
  File "/usr/lib/python2.7/dist-packages/OpenSSL/rand.py", line 11, in <module>
    from OpenSSL._util import (
  File "/usr/lib/python2.7/dist-packages/OpenSSL/_util.py", line 6, in <module>
    from cryptography.hazmat.bindings.openssl.binding import Binding
  File "/usr/lib/python2.7/dist-packages/cryptography/hazmat/bindings/openssl/binding.py", line 68, in <module>
    error=-1)
  File "/usr/lib/python2.7/dist-packages/cryptography/hazmat/bindings/openssl/binding.py", line 57, in wrapper
    ffi.def_extern(name=name, **kwargs)(func)
AttributeError: 'CompiledFFI' object has no attribute 'def_extern'

Changed in linux (Ubuntu):
assignee: nobody → Taco Screen team (taco-screen-team)
description: updated
Revision history for this message
Brad Figg (brad-figg) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. From a terminal window please run:

apport-collect 1555723

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
Revision history for this message
Adam Conrad (adconrad) wrote :

All the /usr/local in this (including /usr/local/bin/pip) makes it look like it's definitely not our pip (which ships as /usr/bin/pip).

Revision history for this message
Breno Leitão (breno-leitao) wrote : Re: [Bug 1555723] Re: pip is breaking in ppc64el

Hi Adam,

Same problem with Ubuntu's pip:

➜ ~ which pip
/usr/bin/pip

➜ ~ dpkg -S /usr/bin/pip
python-pip: /usr/bin/pip

➜ ~ pip
Traceback (most recent call last):
  File "/usr/bin/pip", line 9, in <module>
    from pip import main
  File "/usr/local/lib/python2.7/dist-packages/pip/__init__.py", line
15, in <module>
    from pip.vcs import git, mercurial, subversion, bazaar # noqa
  File "/usr/local/lib/python2.7/dist-packages/pip/vcs/mercurial.py",
line 10, in <module>
    from pip.download import path_to_url
  File "/usr/local/lib/python2.7/dist-packages/pip/download.py", line
38, in <module>
    from pip._vendor import requests, six
  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/__init__.py",
line 53, in <module>
    from .packages.urllib3.contrib import pyopenssl
  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/contrib/pyopenssl.py",
line 53, in <module>
    import OpenSSL.SSL
  File "/usr/lib/python2.7/dist-packages/OpenSSL/__init__.py", line 8,
in <module>
    from OpenSSL import rand, crypto, SSL
  File "/usr/lib/python2.7/dist-packages/OpenSSL/rand.py", line 11, in <module>
    from OpenSSL._util import (
  File "/usr/lib/python2.7/dist-packages/OpenSSL/_util.py", line 6, in <module>
    from cryptography.hazmat.bindings.openssl.binding import Binding
  File "/usr/lib/python2.7/dist-packages/cryptography/hazmat/bindings/openssl/binding.py",
line 68, in <module>
    error=-1)
  File "/usr/lib/python2.7/dist-packages/cryptography/hazmat/bindings/openssl/binding.py",
line 57, in wrapper
    ffi.def_extern(name=name, **kwargs)(func)
AttributeError: 'CompiledFFI' object has no attribute 'def_extern'

On Fri, Mar 11, 2016 at 12:41 AM, Adam Conrad <adconrad@0c3.net> wrote:
> All the /usr/local in this (including /usr/local/bin/pip) makes it look
> like it's definitely not our pip (which ships as /usr/bin/pip).
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1555723
>
> Title:
> pip is breaking in ppc64el
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1555723/+subscriptions

Revision history for this message
Steve Langasek (vorlon) wrote :

Barry, can you have a look at this issue, please? If you need access to a 16.04 POWER system (since the porter box is still not 16.04-capable), you can ask Mathieu to get you access.

affects: linux (Ubuntu) → python-cryptography (Ubuntu)
Changed in python-cryptography (Ubuntu):
assignee: Taco Screen team (taco-screen-team) → Barry Warsaw (barry)
Changed in python-cryptography (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Barry Warsaw (barry) wrote :

This is still incredibly odd because your traceback still flows through /usr/local, which the apt installed pip would never do. So I think you have some stuff installed in /usr/local, and possibly a PYTHONPATH, that is breaking the system installed pip.

Note that on Debian (and derived) /usr/local/lib/python2.7/dist-packages is on the standard python2.7 sys.path *before* /usr/lib/python2.7/dist-packages expressly so that system administrators can modify how Python works, but it's also incumbent on the system admin to make sure that anything installed there won't break the system packages. It looks like this is what's happening for you. I doubt it has anything to do with the architecture of the machine.

Please start by clearing out any custom stuff you might have in /usr/local/lib/python2.7/dist-packages and try again.

Barry Warsaw (barry)
Changed in python-cryptography (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Breno Leitão (breno-leitao) wrote :

Sorry for the noise, I just tried on another machine and it works fine. The problem was relatively to my environment.

Changed in python-cryptography (Ubuntu):
status: Incomplete → Invalid
Revision history for this message
Ori Avtalion (salty-horse) wrote :

I have this bug, after upgrading from Ubuntu 15.10 to 16.04

>>> import OpenSSL
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/OpenSSL/__init__.py", line 8, in <module>
    from OpenSSL import rand, crypto, SSL
  File "/usr/lib/python2.7/dist-packages/OpenSSL/rand.py", line 11, in <module>
    from OpenSSL._util import (
  File "/usr/lib/python2.7/dist-packages/OpenSSL/_util.py", line 6, in <module>
    from cryptography.hazmat.bindings.openssl.binding import Binding
  File "/usr/lib/python2.7/dist-packages/cryptography/hazmat/bindings/openssl/binding.py", line 68, in <module>
    error=-1)
  File "/usr/lib/python2.7/dist-packages/cryptography/hazmat/bindings/openssl/binding.py", line 57, in wrapper
    ffi.def_extern(name=name, **kwargs)(func)
AttributeError: 'CompiledFFI' object has no attribute 'def_extern'

Revision history for this message
Paulo José (pauloup) wrote :

Same error after upgrade from Ubuntu 15.04 to 16.04.
Solved it manually removing cryptography and re-installing with:
# sudo rmv -R /usr/lib/python2.7/dist-packages/cryptography
# pip install cryptography

The error:
paulo@paulo-Aspire-5742 ~> pip
Traceback (most recent call last):
  File "/usr/bin/pip", line 9, in <module>
    from pip import main
  File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 13, in <module>
    from pip.exceptions import InstallationError, CommandError, PipError
  File "/usr/lib/python2.7/dist-packages/pip/exceptions.py", line 6, in <module>
    from pip._vendor.six import iteritems
  File "/usr/lib/python2.7/dist-packages/pip/_vendor/__init__.py", line 64, in <module>
    vendored("cachecontrol")
  File "/usr/lib/python2.7/dist-packages/pip/_vendor/__init__.py", line 36, in vendored
    __import__(modulename, globals(), locals(), level=0)
  File "/usr/share/python-wheels/CacheControl-0.11.5-py2.py3-none-any.whl/cachecontrol/__init__.py", line 9, in <module>
  File "/usr/share/python-wheels/CacheControl-0.11.5-py2.py3-none-any.whl/cachecontrol/wrapper.py", line 1, in <module>
  File "/usr/share/python-wheels/CacheControl-0.11.5-py2.py3-none-any.whl/cachecontrol/adapter.py", line 3, in <module>
  File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/__init__.py", line 53, in <module>
  File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-any.whl/urllib3/contrib/pyopenssl.py", line 54, in <module>
  File "/usr/lib/python2.7/dist-packages/OpenSSL/__init__.py", line 8, in <module>
    from OpenSSL import rand, crypto, SSL
  File "/usr/lib/python2.7/dist-packages/OpenSSL/rand.py", line 11, in <module>
    from OpenSSL._util import (
  File "/usr/lib/python2.7/dist-packages/OpenSSL/_util.py", line 6, in <module>
    from cryptography.hazmat.bindings.openssl.binding import Binding
  File "/usr/lib/python2.7/dist-packages/cryptography/hazmat/bindings/openssl/binding.py", line 68, in <module>
    error=-1)
  File "/usr/lib/python2.7/dist-packages/cryptography/hazmat/bindings/openssl/binding.py", line 57, in wrapper
    ffi.def_extern(name=name, **kwargs)(func)
AttributeError: 'CompiledFFI' object has no attribute 'def_extern'

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

Other bug subscribers

Remote bug watches

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