boltgolt / howdy

🛡️ Windows Hello™ style facial authentication for Linux
MIT License
5.73k stars 299 forks source link

Error during installation: post-installation script fails with "externally-managed-environment" #954

Open Chrisz7709 opened 2 weeks ago

Chrisz7709 commented 2 weeks ago

I'm having trouble installing Howdy (version 2.6.1). The installation fails during the post-installation script, and I get this error message:

There's a syntax warning about an invalid escape sequence, and then it says "error: externally-managed-environment." It suggests using apt install for system-wide packages or creating a virtual environment if I want to install non-Debian packages. It also mentions that I can override this with --break-system-packages, but I'm worried that could mess up my Python installation or the OS.

Steps to reproduce

I tried to install Howdy using the command sudo apt install howdy.

System Information

OS: Ubuntu  24.04.1
Howdy version: 2.6.1

Troubleshooting Steps Taken

I completely removed Howdy with sudo apt remove --purge howdy.
I ran sudo apt --fix-broken install to fix any broken packages.
I updated the package list with sudo apt update.
I made sure all required dependencies are installed, including Python and related packages.
I tried reinstalling Howdy after checking the dependencies.

Even after all this, the installation keeps failing with the same error.

Additional Notes

I really don’t want to use the --break-system-packages option because I’m worried it might cause more problems.

If anyone has run into this issue or has any suggestions on how to fix it, I’d really appreciate the help!

jacobenosky commented 2 weeks ago

I am in the exact same situation as you. Running a Dell XPS 13 2 in 1.

ThanosSkentzos commented 1 week ago

I have the same issue and as I understand the situation it happens because after updating my distro my system python is now protected in a way. Following this stack overflow post i found that i could bypass that by doing sudo mv /usr/lib/python3.12/EXTERNALLY-MANAGED /usr/lib/python3.12/EXTERNALLY-MANAGED.old That overcame the error about the externally managed env. However this is probably potentially dangerous because you start messing with your systems python.

However then the installation tried to upgrade my local pip env from 2.40 to 2.42 which resulted in a new error.

Using cached pip-24.2-py3-none-any.whl (1.8 MB)
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 24.0
ERROR: Cannot uninstall pip 24.0, RECORD file not found. Hint: The package was installed by debian.

I tried upgrading my system pythons pip version but was not able to get it to 24.2 so the installation keeps failing


EDIT: added logs

Reading package lists... Done  
Building dependency tree... Done  
Reading state information... Done  
Suggested packages:  
  nvidia-cuda-dev  
The following NEW packages will be installed:  
  howdy  
0 upgraded, 1 newly installed, 0 to remove and 3 not upgraded.  
Need to get 0 B/38,9 kB of archives.  
After this operation, 166 kB of additional disk space will be used.  
Selecting previously unselected package howdy.  
(Reading database ... 671447 files and directories currently installed.)  
Preparing to unpack .../archives/howdy_2.6.1_all.deb ...  
Starting IR camera check...  

Trying "HD Webcam: HD Webcam"  
One of your cameras should now be on.  
Did your IR emitters turn on? [y/N]: y  

Starting certainty auto config...  

After detection, Howdy knows how certain it is that the match is correct.  
How certain Howdy needs to be before authenticating you can be customized.  

F: Fast.  
Allows more fuzzy matches, but speeds up the scanning process greatly.  

B: Balanced.  
Still relatively quick detection, but might not log you in when further away.  

S: Secure.  
The safest option, but will take much longer to authenticate you.  

You can always change this setting in the config.  
What profile would you like to use? [f/b/s]: f  

Unpacking howdy (2.6.1) ...  
Setting up howdy (2.6.1) ...  
/var/lib/dpkg/info/howdy.postinst:145: SyntaxWarning: invalid escape sequence '\w'  
  "davisking-dlib-\w+/(dlib/(http_client|java|matlab|test/)|"  

>>> Upgrading pip to the latest version  

Requirement already satisfied: pip in /usr/lib/python3/dist-packages (24.0)  
Collecting pip  
  Using cached pip-24.2-py3-none-any.whl.metadata (3.6 kB)  
Using cached pip-24.2-py3-none-any.whl (1.8 MB)  
Installing collected packages: pip  
  Attempting uninstall: pip  
    Found existing installation: pip 24.0  
ERROR: Cannot uninstall pip 24.0, RECORD file not found. Hint: The package was installed by debian.  <- HERE
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.12.0-4build2) ...  
Errors were encountered while processing:  
 howdy  
E: Sub-process /usr/bin/dpkg returned an error code (1)  
JVT038 commented 1 week ago

Same problem here.

Running Linux Mint with Lenovo Thinkpad L14 G5

Onion2222 commented 8 hours ago

Same problem after upgrading to Ubuntu24.04