Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python dependencies for each user. Unknowns Error 1 for dependencies quickfix #962

Open
Surferlul opened this issue Oct 9, 2024 · 4 comments

Comments

@Surferlul
Copy link

When authenticating in different places, different users are used (gdm, sudo, gnome authentication dialog). Each of these users needs all valid python requirements. This causes dependency issues, because in different contexts, different modules are available. Here is a quickfix, to get all dependencies in line.

You'll want an elevated prompt:

sudo su -

Go to howdy directory, create python venv and activate it

cd /lib64/security/howdy
python3 -m venv .venv
source .venv/bin/activate

Install dependencies:

pip install dlib opencv-python

and finally edit pam.py

- status = subprocess.call(["/usr/bin/python3 " + os.path.dirname(os.path.abspath(__file__)) + "/compare.py " + pamh.get_user() + " &> /dev/null"], shell=True)
+ status = subprocess.call(["/lib64/security/howdy/.venv/bin/python " + os.path.dirname(os.path.abspath(__file__)) + "/compare.py " + pamh.get_user() + " &> /dev/null"], shell=True)

I created this issue, because I had a lot of errors, and they all just boiled down to broken dependencies


I've searched for similar issues already, and my issue has not been reported yet.

Linux distribution: Fedora 40

Howdy version: 2.6.1

@hlarc
Copy link

hlarc commented Nov 27, 2024

did you build it from source or did you install an already build version?

@Surferlul
Copy link
Author

I installed the fedora package

@hlarc
Copy link

hlarc commented Nov 28, 2024

Ok i tried to replicate your steps but couldnt seem to find the string or anything comparable in the pam.py.
I checked with apt wich version and it said 2.6.1.

@Surferlul
Copy link
Author

In 2.6.1 this is the line you have to change:

status = subprocess.call(["/usr/bin/python3", os.path.dirname(os.path.abspath(__file__)) + "/compare.py", pamh.get_user()])

A more general version of the new line(s) is

howdy_dir = os.path.dirname(os.path.abspath(__file__))
status = subprocess.call([f"{howdy_dir}/.venv/bin/python", f"{howdy_dir}/compare.py", pamh.get_user()])

or

status = subprocess.call([f"{<PATH_TO_YOUR/.venv>}/bin/python", os.path.dirname(os.path.abspath(__file__)) + "/compare.py", pamh.get_user()])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants