howdy icon indicating copy to clipboard operation
howdy copied to clipboard

Problems running on Ubuntu 23.04 (lunar)

Open tante opened this issue 1 year ago • 18 comments

Ubuntu 23.04 comes with a new version of Python (default is 3.11) that makes howdy not run properly.

The first issue is line 10 in pam.py: import ConfigParser The module is now called configparser so howdy can't properly import it.

Then the python 'dlib' module was missing, I installed it via sudo pip install --break-system-packages dlib.

Doing a mitigation by changing that line to import configparser as ConfigParser makes howdy work in GDM for login but when using it in sudo creates a funky error:

Traceback (most recent call last):
  File "/lib/security/howdy/compare.py", line 23, in <module>
    from recorders.video_capture import VideoCapture

The strange thing is: If you add import recorders to the file there is no problem. Just importing that submodule fails and seemingly only while trying it via sudo.


Linux distribution (if applicable): Ubuntu 23.04

Howdy version (sudo howdy version): Howdy 2.6.1

tante avatar Apr 20 '23 22:04 tante

After changing the configparser import I had a different issue:

ModuleNotFoundError: No module named 'dlib'

After installing dlib with sudo pip install --break-system-packages dlib everything is working now.

ashkop avatar Apr 21 '23 08:04 ashkop

@ashkop You made my day. Howdy is working fine in my Kubuntu 23.04 now.

sudo apt install -y python3-opencv
sudo pip install --break-system-packages dlib
sudo howdy add

kimhongsu avatar Apr 21 '23 14:04 kimhongsu

@kimhongsu I'm glad that helped. Would still be nice if howdy can be fully updated to python 3.

ashkop avatar Apr 21 '23 15:04 ashkop

Purge and reinstall seems to have run into errors:

Setting up howdy (2.6.1) ...

>>> Upgrading pip to the latest version

error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.
    
    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.
    
    If you wish to install a non-Debian packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.
    
    See /usr/share/doc/python3.11/README.venv for more information.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
Error while running last command
dpkg: error processing package howdy (--configure):
 installed howdy package post-installation script subprocess returned error exit status 1
Processing triggers for man-db (2.11.2-1) ...
Processing triggers for libc-bin (2.37-0ubuntu2) ...
Errors were encountered while processing:
 howdy
E: Sub-process /usr/bin/dpkg returned an error code (1)

adamlove86 avatar Apr 22 '23 01:04 adamlove86

Here's my ugly hack workaround that also works for fresh install of howdy on 23.04, just skip the "apt remove howdy" command. Doing this also fixes the error when authenticating sudo in the first comment.

sudo -i mv /usr/lib/python3.11/EXTERNALLY-MANAGED /usr/lib/python3.11/DISABLED-EXTERNALLY-MANAGED apt remove howdy pip3 install dlib apt install howdy nano /lib/security/howdy/pam.py # Change ConfigParser to configparser on 2 lines mv /usr/lib/python3.11/DISABLED-EXTERNALLY-MANAGED /usr/lib/python3.11/EXTERNALLY-MANAGED

mstrobl2 avatar Apr 23 '23 03:04 mstrobl2

nano /lib/security/howdy/pam.py # Change ConfigParser to configparser on 2 lines

note: You also need to change it elsewhere, or just change the line to import configparser as ConfigParser

skjerns avatar Apr 23 '23 16:04 skjerns

This is an annoying one, using --break-system-packages should help but it's really not the clean way to do it. Maybe a venv for Howdy would be better

boltgolt avatar Apr 23 '23 18:04 boltgolt

I've recently updated to Ubuntu 23.04 and Howdy is not working on the lock screen. I tried to reinstall it but it didn't work. I can still add new faces and Howdy seems to work fine in the terminal and gives me no errors.

Arad-Afzali avatar Apr 27 '23 22:04 Arad-Afzali

--break-system-packages is not a good practice. Maybe howdy could use virtual environments to install this package.

dingwen07 avatar May 18 '23 01:05 dingwen07

Purge and reinstall seems to have run into errors:

Setting up howdy (2.6.1) ...

>>> Upgrading pip to the latest version

error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.
    
    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.
    
    If you wish to install a non-Debian packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.
    
    See /usr/share/doc/python3.11/README.venv for more information.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
Error while running last command
dpkg: error processing package howdy (--configure):
 installed howdy package post-installation script subprocess returned error exit status 1
Processing triggers for man-db (2.11.2-1) ...
Processing triggers for libc-bin (2.37-0ubuntu2) ...
Errors were encountered while processing:
 howdy
E: Sub-process /usr/bin/dpkg returned an error code (1)

I've got the exact same issue with a fresh install of Ubuntu 23.04 Linux 6.2.0-20-generic 64-bit. Wrapping howdy inside of it's own venv would be the optimal solution here and for isolating its install further from the host.

nate3D avatar May 26 '23 04:05 nate3D

@nate3D Thanks for the solution, could you please share an example of how to do the "Wrapping howdy inside of it's own venv"?

MurzNN avatar Jun 10 '23 11:06 MurzNN

I've found a solution to the ModuleNotFoundError: No module named 'ConfigParser' error, the fix is in the https://github.com/boltgolt/howdy/issues/799

MurzNN avatar Jun 11 '23 04:06 MurzNN

To those who are not willing to use --break-system-packages:

sudo pip install -t /lib/security/howdy dlib

Tested on the beta branch, should work on master.

Rongronggg9 avatar Jun 21 '23 16:06 Rongronggg9

This is an annoying one, using --break-system-packages should help but it's really not the clean way to do it. Maybe a venv for Howdy would be better

@boltgolt Could you let us know how to wrap howdy up with venv? Or is it possible to wrap howdy up with docker?

kimhongsu avatar Aug 19 '23 13:08 kimhongsu

To those who are not willing to use --break-system-packages:

sudo pip install -t /lib/security/howdy dlib

Tested on the beta branch, should work on master.

@boltgolt Perhaps this fix can be incorporated in release or at least beta?

Spurlos avatar Sep 22 '23 11:09 Spurlos

To those who are not willing to use --break-system-packages:

sudo pip install -t /lib/security/howdy dlib

Tested on the beta branch, should work on master.

@boltgolt Perhaps this fix can be incorporated in release or at least beta?

Tried on ubuntu 23.10 Could install howdy after installing dlib like this, but could not run howdy.

g1ronn1mo avatar Dec 10 '23 07:12 g1ronn1mo

Purge and reinstall seems to have run into errors:

Setting up howdy (2.6.1) ...

>>> Upgrading pip to the latest version

error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.
    
    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.
    
    If you wish to install a non-Debian packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.
    
    See /usr/share/doc/python3.11/README.venv for more information.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
Error while running last command
dpkg: error processing package howdy (--configure):
 installed howdy package post-installation script subprocess returned error exit status 1
Processing triggers for man-db (2.11.2-1) ...
Processing triggers for libc-bin (2.37-0ubuntu2) ...
Errors were encountered while processing:
 howdy
E: Sub-process /usr/bin/dpkg returned an error code (1)

I am also get the same problem on Ubuntu version 23.10.1

Howdy Installation Issue on Ubuntu 23.10.1

Problem:

I encountered an issue with Howdy installation on Ubuntu version 23.10.1. The provided solutions seemed to have complications.

Workaround:

I found a workaround that worked for me, even on a fresh install of Ubuntu 23.10.1. Skip the "apt remove howdy" command to avoid additional errors during sudo authentication.

  1. Open a root shell:

    sudo -i
    
    
  2. Move the EXTERNALLY-MANAGED directory:

      mv /usr/lib/python3.11/EXTERNALLY-MANAGED /usr/lib/python3.11/DISABLED-EXTERNALLY-MANAGED
    
    
  3. Remove Howdy (skip if fresh install):

     apt remove howdy
    
    
  4. Install dlib using pip3: pip3 install dlib

    If pip3 doesn't work, try pip install dlib. If that also fails, attempt: sudo pip install --break-system-packages dlib

  5. Reinstall Howdy:

     apt install howdy
    
    
  6. Edit pam.py to fix import error:

     nano /lib/security/howdy/pam.py
    
    

Change import ConfigParser to import configparser as ConfigParser you can find on lines 2 to 11.

  1. Restore EXTERNALLY-MANAGED directory:
     mv /usr/lib/python3.11/DISABLED-EXTERNALLY-MANAGED /usr/lib/python3.11/EXTERNALLY-MANAGED 
    
    

This workaround should help resolve the installation issues in my case.

While adding face some time you will get device_path problem but i am solve it like this.

 # Should be set automatically by an installer if your distro has one
 # device_path = /dev/v4l/by-path/pci-0000:00:14.0-usb-0:6:1.2-video-index1 # default in my config comment it add new below like this
 device_path = /dev/video0 

4mritGiri avatar Dec 11 '23 02:12 4mritGiri

https://github.com/boltgolt/howdy/issues/851

I also have a silution without breaking system packages. This solution depends on a dep package which is not released yet.

g1ronn1mo avatar Dec 11 '23 09:12 g1ronn1mo