matiasdelellis / facerecognition

Nextcloud app that implement a basic facial recognition system.
GNU Affero General Public License v3.0
524 stars 47 forks source link

App "Face Recognition" cannot be installed because the following dependencies are not fulfilled: The library bz2 is not available. #439

Closed Side2 closed 3 years ago

Side2 commented 3 years ago

Hi I'm struggling to get your Face recognition app installed on my setup.

I'm running Nextcloud 20.08 on Ubuntu 20.04 LTS (upgraded from 18.04 LTS)

When trying to install the app "Face Recognition", I get this error: App "Face Recognition" cannot be installed because the following dependencies are not fulfilled: The library bz2 is not available.

I installed libbz2-dev with the command: apt-get -y install libbz2-dev

Are additional configuration steps needed?

Note, the same error came up regarding PDLib, which I was able to solve by adding "extension=pdlib.so" to php.ini. Is something similar needed for bz2?

matiasdelellis commented 3 years ago

You must install php-bz2

Side2 commented 3 years ago

Thank you for your quick reply. Just installed php-bz2, still the same error.

matiasdelellis commented 3 years ago

Hi @Side2 About php-bzip2 it's just that. It should just work. You may have to restart php7.3-fpm.

About pdlib https://github.com/matiasdelellis/facerecognition/wiki/Installation

MetallicAchu commented 3 years ago

Hi, I'm facing the same error. This is what I get when I try to install libbz2-dev: ~# apt-get -y install libbz2-dev Reading package lists... Done Building dependency tree Reading state information... Done libbz2-dev is already the newest version (1.0.8-2). 0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.

And this is when installing php-bz2: ~# apt-get install php-bz2 Reading package lists... Done Building dependency tree Reading state information... Done php-bz2 is already the newest version (2:7.4+75). 0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.

I feel at a loss. After spending so long solving the pdlib issue, now this.

Ubuntu 20

MetallicAchu commented 3 years ago

I figured it out! It's working! For @Side2 and anyone using Ubuntu and struggling with this one:

As root:

  1. Make sure to apt-get and install libbz2-dev and php-bz2. If you're not sure run: sudo apt install libbz2 & sudo apt install php-bz2
  2. php --ini will get you your current active php.ini, vim (or whatever editor you use) and add at the end of the file: [bz2] extension=bz2.so (the same way that pdlib was added)
  3. php -m | grep bz2 will give you an error that it can't find bz2.so in the right directory, usually ./usr/local/php74/lib/php/extensions/no-debug-non-zts-20190902/bz2.so
  4. Go to the topmost folder and execute find . -iname bz2.so, this will find the extension you're looking for. for me it was in ./usr/lib/php/20190902/bz2.so
  5. Copy the file to the directory php -m is looking for, and restart php / server / whatever. Run php -m | grep bz2 again to make sure it worked. That's it! You should now be able to install the app.

Don't forget to login as your http user (the one you're using for the control panel - could be admin, could be thisisausername) and configure the models you want facerecognition to use. And don't forget to add a cron job that runs the background_job. For mine I used every 5 minutes: sudo -u MYHTTPUSER php ~/public_html/occ face:background_job -t 240 which means it will run every 5 minutes and will process the background_job for 4 minutes.

Hope this will help someone

I hate Linux

zyphlar commented 3 years ago

For me, my PHP wasn't just called PHP, I had specific versions like php7.3 so I had to do sudo apt install php7.3-bz2

nigelpatsmith commented 3 years ago

Not sure if anyone is still having this issue, but I can't install "php-bz2" (or php7.3-bz2) - it says there are no install candidates:

Package php-bz2 is a virtual package provided by:
  php7.3-bz2 7.3.29-1~deb10u1 [Not candidate version]
  php7.3-bz2 7.3.27-1~deb10u1 [Not candidate version]

Also, it looks like the PHP env is 7.4 - but there doesn't seem to be any php7.4-bz2 package available in this ver of debian that the image is based on?

Majestic7979 commented 5 months ago

Not sure if anyone is still having this issue, but I can't install "php-bz2" (or php7.3-bz2) - it says there are no install candidates:

Package php-bz2 is a virtual package provided by:
  php7.3-bz2 7.3.29-1~deb10u1 [Not candidate version]
  php7.3-bz2 7.3.27-1~deb10u1 [Not candidate version]

Also, it looks like the PHP env is 7.4 - but there doesn't seem to be any php7.4-bz2 package available in this ver of debian that the image is based on?

same, I can't find a solution either :(

matiasdelellis commented 5 months ago

You have universe repository enabled?