gtors / fprint

Python wrapper for libfprint
MIT License
8 stars 13 forks source link

fatal error: gio/gio.h: No such file or directory #6

Open dkibet opened 4 years ago

dkibet commented 4 years ago

This is the complete error message when trying to install. I am using: python 3.8.2 archlinux Cython version 0.29.16 libfprint 1.90.1-1 glibc 2.31-2

ERROR: Command errored out with exit status 1:
   command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ghrfg9uk/fprintw/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ghrfg9uk/fprintw/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/pip-wheel-bdczz12_                                                                                                    
       cwd: /tmp/pip-install-ghrfg9uk/fprintw/                                                                                                                        
  Complete output (24 lines):                                                                                                                                         
  running bdist_wheel                                                                                                                                                 
  running build                                                                                                                                                       
  running build_py                                                                                                                                                    
  package init file 'lib/__init__.py' not found (or not a regular file)                                                                                               
  creating build                                                                                                                                                      
  creating build/lib.linux-x86_64-3.8                                                                                                                                 
  creating build/lib.linux-x86_64-3.8/fprint                                                                                                                          
  copying lib/fprint.pyx -> build/lib.linux-x86_64-3.8/fprint                                                                                                         
  copying lib/fprint.pxd -> build/lib.linux-x86_64-3.8/fprint                                                                                                         
  copying lib/fprint.c -> build/lib.linux-x86_64-3.8/fprint                                                                                                           
  running build_ext                                                                                                                                                   
  building 'fprint' extension                                                                                                                                         
  creating build/temp.linux-x86_64-3.8                                                                                                                                
  creating build/temp.linux-x86_64-3.8/lib                                                                                                                            
  gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fno-semantic-interposition -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fPIC -I/usr/include/python3.8 -c lib/fprint.c -o build/temp.linux-x86_64-3.8/lib/fprint.o                                                                                                                                                             
  In file included from /usr/include/libfprint/fp-device.h:23,                                                                                                        
                   from /usr/include/libfprint/fp-context.h:22,                                                                                                       
                   from /usr/include/libfprint/fprint.h:22,                                                                                                           
                   from lib/fprint.c:618:                                                                                                                             
  /usr/include/libfprint/fp-image.h:23:10: fatal error: gio/gio.h: No such file or directory                                                                          
     23 | #include <gio/gio.h>                                                                                                                                        
        |          ^~~~~~~~~~~                                                                                                                                        
  compilation terminated.                                                                                                                                             
  error: command 'gcc' failed with exit status 1                                                                                                                      
  ----------------------------------------                                                                                                                            
  ERROR: Failed building wheel for fprintw
  Running setup.py clean for fprintw
Failed to build fprintw
Installing collected packages: fprintw
    Running setup.py install for fprintw ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ghrfg9uk/fprintw/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ghrfg9uk/fprintw/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-record-5m4eexm6/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/denis/.local/include/python3.8/fprintw
         cwd: /tmp/pip-install-ghrfg9uk/fprintw/
    Complete output (24 lines):
    running install
    running build
    running build_py
    package init file 'lib/__init__.py' not found (or not a regular file)
    creating build
    creating build/lib.linux-x86_64-3.8
    creating build/lib.linux-x86_64-3.8/fprint
    copying lib/fprint.pyx -> build/lib.linux-x86_64-3.8/fprint
    copying lib/fprint.pxd -> build/lib.linux-x86_64-3.8/fprint
    copying lib/fprint.c -> build/lib.linux-x86_64-3.8/fprint
    running build_ext
    building 'fprint' extension
    creating build/temp.linux-x86_64-3.8
    creating build/temp.linux-x86_64-3.8/lib
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fno-semantic-interposition -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fPIC -I/usr/include/python3.8 -c lib/fprint.c -o build/temp.linux-x86_64-3.8/lib/fprint.o
    In file included from /usr/include/libfprint/fp-device.h:23,
                     from /usr/include/libfprint/fp-context.h:22,
                     from /usr/include/libfprint/fprint.h:22,
                     from lib/fprint.c:618:
    /usr/include/libfprint/fp-image.h:23:10: fatal error: gio/gio.h: No such file or directory
       23 | #include <gio/gio.h>
          |          ^~~~~~~~~~~
    compilation terminated.
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ghrfg9uk/fprintw/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ghrfg9uk/fprintw/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-record-5m4eexm6/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/denis/.local/include/python3.8/fprintw Check the logs for full command output.
gtors commented 4 years ago

@dkibet, thanks for reporting the error. I will check it soon.

gtors commented 4 years ago

Libfprint version 1.90.1 is de facto beta 2.0. In other words, the old library API is broken and the wrapper must be completely rewritten. This may take a couple of weeks.

dkibet commented 4 years ago

Libfprint version 1.90.1 is de facto beta 2.0. In other words, the old library API is broken and the wrapper must be completely rewritten. This may take a couple of weeks.

I kind of need it but I'd be happy to wait. Thank you

PS: is it possible to save the prints to a db instead?

dkibet commented 4 years ago

Libfprint version 1.90.1 is de facto beta 2.0. In other words, the old library API is broken and the wrapper must be completely rewritten. This may take a couple of weeks.

I just tried with libfprint-V_1_90_0 but i am still getting the same error.

0_99_0 worked, thanks!

gtors commented 4 years ago

After some investigation, I figure out that this wrapper not needed at all for libfprint v2.0

See example from official repo: https://gitlab.freedesktop.org/libfprint/libfprint/-/blob/master/tests/capture.py

dkibet commented 4 years ago

After some investigation, I figure out that this wrapper not needed at all for libfprint v2.0

See example from official repo: https://gitlab.freedesktop.org/libfprint/libfprint/-/blob/master/tests/capture.py

Hey, Sorry i had to take a break from this project, decided to pick it up again. Those examples work great, Thanks!

I am missing one feature though, verification. I can't seem to find documentation anywhere, if you know any more information about it I'd really appreciate it.

gtors commented 4 years ago

If you use this wrapper and LibFprint v0.99.0, you can use examples/verify.py

If you use GLib introspection and LibFprint v2 (1.90.1), then you can explore https://gitlab.freedesktop.org/libfprint/libfprint/-/blob/master/examples/verify.c (I assume you understand C-lang) . Then, using GLib introspection, you can reproduce the example from verify.c, but with a synchronous version of the functions, i.e fp_device_open_sync.

You can also request a python verification example in the official LibFprint repository: https://gitlab.freedesktop.org/libfprint/libfprint/-/issues