cevoaustralia / aws-google-auth

Provides AWS STS credentials based on Google Apps SAML SSO auth (what a jumble!)
MIT License
537 stars 181 forks source link

Failed to Install #121

Open IanJazzNet opened 5 years ago

IanJazzNet commented 5 years ago

Hi Guys,

I am running the latest version of Linux Mint (19 TARA - 4.15.0-39-generic) and failing on installation of this.

The command I am running is

sudo -H pip install "aws-google-auth[u2f]"

The erroneous output I get is:

Building wheels for collected packages: python-u2flib-host, hidapi
  Running setup.py bdist_wheel for python-u2flib-host ... error
  Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-voNvm5/python-u2flib-host/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpEtR7m6pip-wheel- --python-tag cp27:
  usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: -c --help [cmd1 cmd2 ...]
     or: -c --help-commands
     or: -c cmd --help

  error: invalid command 'bdist_wheel'

  ----------------------------------------
  Failed building wheel for python-u2flib-host
  Running setup.py clean for python-u2flib-host
  Running setup.py bdist_wheel for hidapi ... error
  Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-voNvm5/hidapi/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpaxxekxpip-wheel- --python-tag cp27:
  usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: -c --help [cmd1 cmd2 ...]
     or: -c --help-commands
     or: -c cmd --help

  error: invalid command 'bdist_wheel'

  ----------------------------------------
  Failed building wheel for hidapi
  Running setup.py clean for hidapi
Failed to build python-u2flib-host hidapi
Installing collected packages: hidapi, python-u2flib-host
  Running setup.py install for hidapi ... error
    Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-voNvm5/hidapi/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-uVhYuk-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_ext
    cythoning hid.pyx to hid.c
    /tmp/pip-build-voNvm5/hidapi/.eggs/Cython-0.29.1-py2.7-linux-x86_64.egg/Cython/Compiler/Main.py:367: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /tmp/pip-build-voNvm5/hidapi/hid.pyx
      tree = Parsing.p_module(s, pxd, full_module_name)
    building 'hid' extension
    creating build
    creating build/temp.linux-x86_64-2.7
    creating build/temp.linux-x86_64-2.7/hidapi
    creating build/temp.linux-x86_64-2.7/hidapi/libusb
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-3hk45v/python2.7-2.7.15~rc1=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Ihidapi/hidapi -I/usr/include/libusb-1.0 -I/usr/include/python2.7 -c hid.c -o build/temp.linux-x86_64-2.7/hid.o
    hid.c: In function ‘__pyx_pf_3hid_6device_open’:
    hid.c:1967:45: warning: passing argument 1 of ‘PyUnicodeUCS4_AsWideChar’ from incompatible pointer type [-Wincompatible-pointer-types]
           __pyx_v_result = PyUnicode_AsWideChar(__pyx_v_serial_number, __pyx_v_cserial_number, __pyx_v_serial_len);
                                                 ^~~~~~~~~~~~~~~~~~~~~
    In file included from /usr/include/python2.7/Python.h:88:0,
                     from hid.c:4:
    /usr/include/python2.7/unicodeobject.h:246:31: note: expected ‘PyUnicodeObject * {aka struct <anonymous> *}’ but argument is of type ‘PyObject * {aka struct _object *}’
     # define PyUnicode_AsWideChar PyUnicodeUCS4_AsWideChar
                                   ^
    /usr/include/python2.7/unicodeobject.h:591:24: note: in expansion of macro ‘PyUnicode_AsWideChar’
     PyAPI_FUNC(Py_ssize_t) PyUnicode_AsWideChar(
                            ^~~~~~~~~~~~~~~~~~~~
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-3hk45v/python2.7-2.7.15~rc1=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Ihidapi/hidapi -I/usr/include/libusb-1.0 -I/usr/include/python2.7 -c hidapi/libusb/hid.c -o build/temp.linux-x86_64-2.7/hidapi/libusb/hid.o
    hidapi/libusb/hid.c:47:10: fatal error: libusb.h: No such file or directory
     #include <libusb.h>
              ^~~~~~~~~~
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-voNvm5/hidapi/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-uVhYuk-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-voNvm5/hidapi/`

I am pretty sure I have the relevant dependancies:

`$ apt list | grep u2f

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

libcrypt-u2f-server-perl/bionic 0.40-1 amd64
libpam-u2f/bionic 1.0.7-1~ppa1~bionic1 amd64
libu2f-host-dev/bionic 1.1.6-1~ppa1~bionic1 amd64
libu2f-host0/bionic,now 1.1.6-1~ppa1~bionic1 amd64 [installed]
libu2f-server-dev/bionic 1.1.0-1build1 amd64
libu2f-server0/bionic 1.1.0-1build1 amd64
libu2f-udev/bionic,bionic 1.1.6-1~ppa1~bionic1 all
pamu2fcfg/bionic 1.0.7-1~ppa1~bionic1 amd64
python-u2flib-server/bionic,bionic 4.0.1-1 all
python3-u2flib-server/bionic,bionic 4.0.1-1 all
ruby-u2f/bionic,bionic 0.2.1-2 all
u2f-host/bionic 1.1.6-1~ppa1~bionic1 amd64
u2f-server/bionic 1.1.0-1build1 amd64

I have the following installed with pip:

aws-google-auth (0.0.29) boto3 (1.9.58) botocore (1.12.58) google-auth (1.6.1) setuptools (40.6.2) wheel (0.32.3)

Any Ideas why the python-u2flib-host and the hidapi wheels are fialing?

Thanks in advance for any help!

stevemac007 commented 5 years ago

Now we are at the edge of my python install knowledge - will need to do some research into what this could be - replicating it will probably be our biggest challenge as I develop on a Mac and it just works.

Wonder if there is a way to validate this through some combination of a TravisCI build.

povils commented 5 years ago

It just seems that you are missing libusb-dev library:

sudo apt-get install libusb-1.0.0-dev

stevemac007 commented 5 years ago

Good pickup @povils - I'll update the README with this requirement to help in the future.