nischi / MMM-Face-Reco-DNN

Face recognition with opencv and deep neural network
MIT License
90 stars 46 forks source link

Failed to install v.2.0.0 #138

Closed grssll closed 8 months ago

grssll commented 9 months ago

Fresh install on Bullseye 64 bit failed. ''' verbose stack Error: command failed 305 verbose stack at ChildProcess. (/usr/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:53:27) 305 verbose stack at ChildProcess.emit (node:events:513:28) 305 verbose stack at maybeClose (node:internal/child_process:1098:16) 305 verbose stack at ChildProcess._handle.onexit (node:internal/child_process:304:5) 306 verbose pkgid mmm-face-reco-dnn@2.0.0 307 verbose cwd /home/grssl/MagicMirror/modules/MMM-Face-Reco-DNN 308 verbose Linux 6.1.21-v8+ 309 verbose node v19.9.0 310 verbose npm v9.6.3 311 error code 1 312 error path /home/grssl/MagicMirror/modules/MMM-Face-Reco-DNN 313 error command failed 314 error command sh -c pipenv install --site-packages 315 verbose exit 1 316 timing npm Completed in 71476ms 317 verbose code 1 '''

grssll commented 9 months ago

mmm-face-reco-dnn@2.0.0 postinstall pipenv install --site-packages

Installing dependencies from Pipfile.lock (972e4f)... [pipenv.exceptions.InstallError]: Looking in indexes: https://pypi.org/simple, h ttps://www.piwheels.org/simple [pipenv.exceptions.InstallError]: Collecting click==8.1.7 (from -r /tmp/pipenv-h 69qd4km-requirements/pipenv-6wj_7pay-hashed-reqs.txt (line 1)) [pipenv.exceptions.InstallError]: Using cached click-8.1.7-py3-none-any.whl (9 7 kB) [pipenv.exceptions.InstallError]: Collecting dlib==19.24.2 (from -r /tmp/pipenv- h69qd4km-requirements/pipenv-6wj_7pay-hashed-reqs.txt (line 2)) [pipenv.exceptions.InstallError]: Using cached dlib-19.24.2.tar.gz (11.8 MB) [pipenv.exceptions.InstallError]: Installing build dependencies: started [pipenv.exceptions.InstallError]: Installing build dependencies: finished with status 'done' [pipenv.exceptions.InstallError]: Getting requirements to build wheel: started [pipenv.exceptions.InstallError]: Getting requirements to build wheel: finishe d with status 'done' [pipenv.exceptions.InstallError]: Preparing metadata (pyproject.toml): started [pipenv.exceptions.InstallError]: Preparing metadata (pyproject.toml): finishe d with status 'done' [pipenv.exceptions.InstallError]: Collecting face-recognition==1.3.0 (from -r /t mp/pipenv-h69qd4km-requirements/pipenv-6wj_7pay-hashed-reqs.txt (line 3)) [pipenv.exceptions.InstallError]: Using cached https://www.piwheels.org/simple /face-recognition/face_recognition-1.3.0-py2.py3-none-any.whl (15 kB) [pipenv.exceptions.InstallError]: Collecting face-recognition-models==0.3.0 (fro m -r /tmp/pipenv-h69qd4km-requirements/pipenv-6wj_7pay-hashed-reqs.txt (line 4)) [pipenv.exceptions.InstallError]: Using cached face_recognition_models-0.3.0.t ar.gz (100.1 MB) [pipenv.exceptions.InstallError]: Preparing metadata (setup.py): started [pipenv.exceptions.InstallError]: Preparing metadata (setup.py): finished with status 'done' [pipenv.exceptions.InstallError]: Collecting numpy==1.25.2 (from -r /tmp/pipenv- h69qd4km-requirements/pipenv-6wj_7pay-hashed-reqs.txt (line 5)) [pipenv.exceptions.InstallError]: Using cached numpy-1.25.2-cp39-cp39-manylinu x_2_17_aarch64.manylinux2014_aarch64.whl (14.2 MB) [pipenv.exceptions.InstallError]: Collecting opencv-python==4.8.0.74 (from -r /t mp/pipenv-h69qd4km-requirements/pipenv-6wj_7pay-hashed-reqs.txt (line 6)) [pipenv.exceptions.InstallError]: Using cached opencv_python-4.8.0.74-cp37-abi 3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (41.0 MB) [pipenv.exceptions.InstallError]: Requirement already satisfied: picamera2==0.3. 12 in /usr/lib/python3/dist-packages (from -r /tmp/pipenv-h69qd4km-requirements/ pipenv-6wj_7pay-hashed-reqs.txt (line 7)) (0.3.12) [pipenv.exceptions.InstallError]: Requirement already satisfied: pidng==4.0.9 in /usr/lib/python3/dist-packages (from -r /tmp/pipenv-h69qd4km-requirements/pipen v-6wj_7pay-hashed-reqs.txt (line 8)) (4.0.9) [pipenv.exceptions.InstallError]: Requirement already satisfied: piexif==1.1.3 i n /usr/lib/python3/dist-packages (from -r /tmp/pipenv-h69qd4km-requirements/pipe nv-6wj_7pay-hashed-reqs.txt (line 9)) (1.1.3) [pipenv.exceptions.InstallError]: Collecting pillow==10.0.0 (from -r /tmp/pipenv -h69qd4km-requirements/pipenv-6wj_7pay-hashed-reqs.txt (line 10)) [pipenv.exceptions.InstallError]: Using cached Pillow-10.0.0-cp39-cp39-manylin ux_2_28_aarch64.whl (3.2 MB) [pipenv.exceptions.InstallError]: Collecting python-prctl==1.8.1 (from -r /tmp/p ipenv-h69qd4km-requirements/pipenv-6wj_7pay-hashed-reqs.txt (line 11)) [pipenv.exceptions.InstallError]: Using cached python-prctl-1.8.1.tar.gz (28 k B) [pipenv.exceptions.InstallError]: Preparing metadata (setup.py): started [pipenv.exceptions.InstallError]: Preparing metadata (setup.py): finished with status 'error' [pipenv.exceptions.InstallError]: WARNING: Retrying (Retry(total=4, connect=None , read=None, redirect=None, status=None)) after connection broken by 'ProtocolEr ror('Connection aborted.', RemoteDisconnected('Remote end closed connection with out response'))': /simple/picamera2/ [pipenv.exceptions.InstallError]: error: subprocess-exited-with-error [pipenv.exceptions.InstallError]: [pipenv.exceptions.InstallError]: × python setup.py egg_info did not run succe ssfully. [pipenv.exceptions.InstallError]: │ exit code: 1 [pipenv.exceptions.InstallError]: ╰─> [1 lines of output] [pipenv.exceptions.InstallError]: You need to install libcap development h eaders to build this module [pipenv.exceptions.InstallError]: [end of output] [pipenv.exceptions.InstallError]: [pipenv.exceptions.InstallError]: note: This error originates from a subproces s, and is likely not a problem with pip. [pipenv.exceptions.InstallError]: error: metadata-generation-failed [pipenv.exceptions.InstallError]: [pipenv.exceptions.InstallError]: × Encountered error while generating package m etadata. [pipenv.exceptions.InstallError]: ╰─> See above for output. [pipenv.exceptions.InstallError]: [pipenv.exceptions.InstallError]: note: This is an issue with the package mentio ned above, not pip. [pipenv.exceptions.InstallError]: hint: See above for details. ERROR: Couldn't install package: {} Package installation failed... /usr/lib/python3.9/subprocess.py:1052: ResourceWarning: subprocess 1644 is still running _warn("subprocess %s is still running" % self.pid, ResourceWarning: Enable tracemalloc to get the object allocation traceback sys:1: ResourceWarning: unclosed file <_io.TextIOWrapper name=4 encoding='utf-8' > ResourceWarning: Enable tracemalloc to get the object allocation traceback sys:1: ResourceWarning: unclosed file <_io.TextIOWrapper name=7 encoding='utf-8' > ResourceWarning: Enable tracemalloc to get the object allocation traceback npm ERR! code 1 npm ERR! path /home/grssl/MagicMirror/modules/MMM-Face-Reco-DNN npm ERR! command failed npm ERR! command sh -c pipenv install --site-packages

nischi commented 9 months ago

hi @grssll sorry for the issues. seems there is a missing dependency you need to install. I tried so many things till it worked, seems i already had installed it.

sudo apt install -y libcap-dev

and after that

npm run postinstall

Maybe it happens that you have other missing dependencies, so please if so, tell me :) then i will add them to the install description

kind regards

ashbytaylors commented 9 months ago

Getting the same issue but it's moaning about opencv-python==4.8.0.74 and I can't get pip to install opencv-python==4.8.0.74, it just ends with 'killed' after collecting it. Pip also fails to install the latest version of opencv-python. Did the previous version of Face-Reco use opencv-python? I don't think so because it's not in my pip -list. I have the latest version of opencv installed as a .deb

My environment is as follows:

            Python: 3.9.2
            platform: Linux-6.1.21-v7+-armv7l-with-glibc2.31
            glibc: glibc 2.31
            machine: armv7l
            bits: 32
            pip: n/a
            setuptools: 68.2.2
            scikit-build: 0.17.6
            PEP517_BUILD_BACKEND=setuptools.build_meta
grssll commented 9 months ago

hi @grssll sorry for the issues. seems there is a missing dependency you need to install. I tried so many things till it worked, seems i already had installed it.

sudo apt install -y libcap-dev

and after that

npm run postinstall

Maybe it happens that you have other missing dependencies, so please if so, tell me :) then i will add them to the install description

kind regards

Been sitting on installing dependencies from PIpfile.lock (972e4f) for a couple hours now. No install. Pi froze after 3 hours and had to reboot. Tried again with the same result. Thanks

nischi commented 9 months ago

hi guys

i'm sorry that it is not working to install. Did you have enough cooling for your raspberry pi? Because this is a heavy library which need to compile first. It took also really long on my raspberry pi, but with a little bit extra air to the raspberry pi it worked.

It will do the same as in the old installation script of the previous version of my module, but "simply" over pip.

@ashbytaylors it was not installed via pip before, but should not make a difference. I will investigate if there are a more slim version of it that it goes smoother.

But in the meantime, can you try to cool down your raspberry pi more?

Sorry and kind regards

grssll commented 9 months ago

@nischi Ice cooler with the fan set to turn on on 60. Fan is idle all the time. Will try tonight 32bit OS

nischi commented 9 months ago

Hmmm strange. Btw: i do have also the 64bit OS, so this should actually work.

grssll commented 9 months ago

I have:

mmm-face-reco-dnn@2.0.0 postinstall pipenv install --site-packages Installing dependencies from Pipfile.lock (972e4f)...

nischi commented 9 months ago

and this freez your raspberry pi? Or is it still working?

grssll commented 9 months ago

Still working? but nothing changes in the terminal. Stays on the same line

grssll commented 9 months ago

MMMFRD

nischi commented 9 months ago

can you check the cpu usage? is it doing something?

grssll commented 9 months ago

2

grssll commented 9 months ago

24% cpu usage

nischi commented 9 months ago

yes one core is fully usaged, so seems he is working. cc1plus is the compiler to compiling the opencv. depending on the power of your raspberry pi, it can take a long time

grssll commented 9 months ago

Pi4 4gb

nischi commented 9 months ago

yeah this is great, but still take a while :) I will investigate that we can use a more slim library

grssll commented 9 months ago

Sat there for 5 hours nothing changed and froze again.

grssll commented 9 months ago

mmm-face-reco-dnn@2.0.0 postinstall pipenv install --site-packages

Creating a virtualenv for this project... Pipfile: /home/grssl/MagicMirror/modules/MMM-Face-Reco-DNN/Pipfile Using /usr/bin/python3.9 (3.9.2) to create virtualenv... Making site-packages available... ⠏ Creating virtual environment...created virtual environment CPython3.9.2.final. 0-64 in 2351ms creator CPython3Posix(dest=/home/grssl/.local/share/virtualenvs/MMM-Face-Reco- DNN-XqMQwW8X, clear=False, no_vcs_ignore=False, global=True) seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle , via=copy, app_data_dir=/home/grssl/.local/share/virtualenv) added seed packages: pip==23.2.1, setuptools==68.2.0, wheel==0.41.2 activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerS hellActivator,PythonActivator

✔ Successfully created virtual environment! Virtualenv location: /home/grssl/.local/share/virtualenvs/MMM-Face-Reco-DNN-XqMQ wW8X Installing dependencies from Pipfile.lock (972e4f)...

Tried on new install. After about 15min freezes and not responds.

mikecheng2626 commented 9 months ago

I have:

mmm-face-reco-dnn@2.0.0 postinstall pipenv install --site-packages Installing dependencies from Pipfile.lock (972e4f)...

I'm stuck at the start as well.

magicmirror@pi:~ $ cd ~/MagicMirror/modules magicmirror@pi:~/MagicMirror/modules $ cd MMM-Face-Reco-DNN magicmirror@pi:~/MagicMirror/modules/MMM-Face-Reco-DNN $ npm install

mmm-face-reco-dnn@2.0.0 postinstall pipenv install --site-packages

Installing --site-packages… ⠋WARNING: Expected package name at the start of dependency specifier --site-packages ^ ABORTING INSTALL... You will have to reinstall any packages that failed to install. You may have to manually run pipenv lock when you are finished. npm ERR! code 1 npm ERR! path /home/magicmirror/MagicMirror/modules/MMM-Face-Reco-DNN npm ERR! command failed npm ERR! command sh -c pipenv install --site-packages

npm ERR! A complete log of this run can be found in: /home/magicmirror/.npm/_logs/2023-10-04T00_23_48_590Z-debug-0.log

nischi commented 9 months ago

mmm-face-reco-dnn@2.0.0 postinstall pipenv install --site-packages

Creating a virtualenv for this project... Pipfile: /home/grssl/MagicMirror/modules/MMM-Face-Reco-DNN/Pipfile Using /usr/bin/python3.9 (3.9.2) to create virtualenv... Making site-packages available... ⠏ Creating virtual environment...created virtual environment CPython3.9.2.final. 0-64 in 2351ms creator CPython3Posix(dest=/home/grssl/.local/share/virtualenvs/MMM-Face-Reco- DNN-XqMQwW8X, clear=False, no_vcs_ignore=False, global=True) seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle , via=copy, app_data_dir=/home/grssl/.local/share/virtualenv) added seed packages: pip==23.2.1, setuptools==68.2.0, wheel==0.41.2 activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerS hellActivator,PythonActivator

✔ Successfully created virtual environment! Virtualenv location: /home/grssl/.local/share/virtualenvs/MMM-Face-Reco-DNN-XqMQ wW8X Installing dependencies from Pipfile.lock (972e4f)...

Tried on new install. After about 15min freezes and not responds.

What do you meen with freez? Is the whole system hanging?

nischi commented 9 months ago

I have:

mmm-face-reco-dnn@2.0.0 postinstall pipenv install --site-packages Installing dependencies from Pipfile.lock (972e4f)...

I'm stuck at the start as well.

magicmirror@pi:~ $ cd ~/MagicMirror/modules magicmirror@pi:~/MagicMirror/modules $ cd MMM-Face-Reco-DNN magicmirror@pi:~/MagicMirror/modules/MMM-Face-Reco-DNN $ npm install

mmm-face-reco-dnn@2.0.0 postinstall pipenv install --site-packages

Installing --site-packages… ⠋WARNING: Expected package name at the start of dependency specifier --site-packages ^ ABORTING INSTALL... You will have to reinstall any packages that failed to install. You may have to manually run pipenv lock when you are finished. npm ERR! code 1 npm ERR! path /home/magicmirror/MagicMirror/modules/MMM-Face-Reco-DNN npm ERR! command failed npm ERR! command sh -c pipenv install --site-packages

npm ERR! A complete log of this run can be found in: /home/magicmirror/.npm/_logs/2023-10-04T00_23_48_590Z-debug-0.log

which version of pip and pipenv did you have?

grssll commented 9 months ago

@nischi Yes, Pi not responding and I need to remove power to reboot. Tried few times with the same result. Thanks

nischi commented 9 months ago

i need to reset my pi again and will try it also. will keep you posted.

grssll commented 9 months ago

nodejs: 20.8.0 pip: 20.3.4 , Python 3.9 pipenv: 2023.10.3 Operating System: Debian GNU/Linux 11 (bullseye) Kernel: Linux 6.1.21-v8+ Architecture: arm64

ashbytaylors commented 9 months ago

I've given up trying to install opencv via PIP on a Pi3B. It never completes the compile (gets killed) or hangs the machine after a few hours. However sudo apt-get install python3-opencv installs the necessary libraries etc. How do I either get the latest version of Face-Reco to use this OR revert back to the previous version of Face-Recp so that I can get it working on my Pi3B again?

grssll commented 9 months ago

@nischi

i need to reset my pi again and will try it also. will keep you posted.

Did you had a time to try and find out whats causing the crash? Cheers

nischi commented 9 months ago

@nischi

i need to reset my pi again and will try it also. will keep you posted.

Did you had a time to try and find out whats causing the crash? Cheers

Hi @grssll sorry, not yet. hope i find some time next week.

nischi commented 9 months ago

I've given up trying to install opencv via PIP on a Pi3B. It never completes the compile (gets killed) or hangs the machine after a few hours. However sudo apt-get install python3-opencv installs the necessary libraries etc. How do I either get the latest version of Face-Reco to use this OR revert back to the previous version of Face-Recp so that I can get it working on my Pi3B again?

hi @ashbytaylors sorry for the issues. you can simply checkout an older tag of my repo.

goldyfruit commented 9 months ago

Got this as well on Bullseye.

pi@rpi4b01:/tmp/MMM-Face-Reco-DNN $ npm install

> mmm-face-reco-dnn@2.0.0 postinstall
> pipenv install --site-packages

Installing --site-packages…
⠋WARNING: Parse error at "'--site-p'": Expected W:(0-9A-Za-z)
ABORTING INSTALL... You will have to reinstall any packages that failed to install.
You may have to manually run pipenv lock when you are finished.
npm ERR! code 1
npm ERR! path /tmp/MMM-Face-Reco-DNN
npm ERR! command failed
npm ERR! command sh -c pipenv install --site-packages
goldyfruit commented 9 months ago

Got this as well on Bullseye.

pi@rpi4b01:/tmp/MMM-Face-Reco-DNN $ npm install

> mmm-face-reco-dnn@2.0.0 postinstall
> pipenv install --site-packages

Installing --site-packages…
⠋WARNING: Parse error at "'--site-p'": Expected W:(0-9A-Za-z)
ABORTING INSTALL... You will have to reinstall any packages that failed to install.
You may have to manually run pipenv lock when you are finished.
npm ERR! code 1
npm ERR! path /tmp/MMM-Face-Reco-DNN
npm ERR! command failed
npm ERR! command sh -c pipenv install --site-packages

pipenv package provided in Debian Bullseye is too old and does not support the --site-packages option, I installed pipenv via pip and it fixed my previous issue.

goldyfruit commented 9 months ago

I was able to install the module on RPi 4B (I first created a wheel file for dlib):

apt install npm python3-pip libcap-dev
python -m venv ~/.virtualenvs/facerecodnn
. ~/.virtualenvs/facerecodnn/bin/activate
pip install pipenv
curl -O --output-dir /tmp https://whl.smartgic.io/dlib-19.24.2-cp39-cp39-linux_aarch64.whl
git clone https://github.com/nischi/MMM-Face-Reco-DNN.git
cd MMM-Face-Reco-DNN
sed -i 's|dlib = "\*"|dlib = {path = "/tmp/dlib-19.24.2-cp39-cp39-linux_aarch64.whl"}|g' Pipfile
npm install

Output:

> mmm-face-reco-dnn@2.0.0 postinstall
> pipenv install --site-packages

Courtesy Notice: Pipenv found itself running within a virtual environment, so it will automatically use that environment, instead of creating its own for any project. You can set PIPENV_IGNORE_VIRTUALENVS=1 to force pipenv to ignore that environment and create its own instead. You can set PIPENV_VERBOSITY=-1 to suppress this warning.
Pipfile.lock not found, creating...
Locking [packages] dependencies...
Building requirements...
Resolving dependencies...
✔ Success!
Locking [dev-packages] dependencies...
Building requirements...
Resolving dependencies...
✔ Success!
Updated Pipfile.lock (e4955206bf2bd75367a77d54d54c936c53e149312b74fa901565ef0bc871f1ff)!
Installing dependencies from Pipfile.lock (71f1ff)...
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.

up to date, audited 229 packages in 41s

105 packages are looking for funding
  run `npm fund` for details

I hope it helps.

mikecheng2626 commented 9 months ago

I did this:

(facerecodnn) magicmirror@pi:~ $ apt install npm python3-pip libcap-dev E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied) E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root? (facerecodnn) magicmirror@pi:~ $ sudo apt install npm python3-pip libcap-dev Reading package lists... Done Building dependency tree... Done Reading state information... Done libcap-dev is already the newest version (1:2.44-1). python3-pip is already the newest version (20.3.4-4+rpt1+deb11u1). Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:

The following packages have unmet dependencies: libnode72 : Conflicts: nodejs-legacy nodejs : Conflicts: npm E: Unable to correct problems, you have held broken packages.

How do I fix this?

Note: just an ordinary dude who tries to follow instructions. Not a coder/programmer at all... Had some experience with config/modules and that's about it.

nischi commented 9 months ago

Hi @mikecheng2626 can you tell me which version of npm and node do you have?

you can run npm -v node -v

sdetweil commented 9 months ago

just a note.. the latest MM requires node 18 or 20 (for the internal fetch)

mikecheng2626 commented 9 months ago

Hi @mikecheng2626 can you tell me which version of npm and node do you have?

you can run npm -v node -v

Yes! npm is 9.6.7 node is v18.17.1

sdetweil commented 9 months ago

@mikecheng2626 you already have npm installed, so shouldn't try to install it again

installing node 18 or 20 is a nightmare as they changed the process too.

my mm install script handles node and npm using the n command. (not apt) and does all the work.

grssll commented 9 months ago

Hi @nischi Did you had a chance to look at the code to implement the fix? Thanks

nischi commented 9 months ago

@grssll I'm so sorry, not yet. My other Projects need a lot of time at the moment. I will try as fast as possible. Hopefully this weekend.

mikecheng2626 commented 9 months ago

@mikecheng2626 you already have npm installed, so shouldn't try to install it again

installing node 18 or 20 is a nightmare as they changed the process too.

my mm install script handles node and npm using the n command. (not apt) and does all the work.

@sdetweil I'm sorry for being stupid, but could you elaborate on the n command? I'm literally a noobie on this, just trying to build my first magic mirror.

sdetweil commented 9 months ago

@mikecheng2626 one can install node and npm system wide. but there are sometimes application conflicts between versions

another app was created nvm (node version manager) which allows you to select a version of node by command prompt and thus application

NVM is installed with apt-get

someone decide that the apt install is too restrictive on many platforms, so they created another new app, n , which is installed thru npm.

because my install script runs in many places, and has to deal with different collections of dependencies, aptget for another tool is difficult.

and the problems with node 18 and 20 using apt are impossible to resolve. I switched to using n.

both nvm and n install the version of node in /usr/local/bin, while apt installs in /usr/bin

/usr/local/bin is searched first..

if n is installed, u can see the versions available and which one is active. if started w sudo, you can change versions on the fly too

marivan38 commented 8 months ago

sorry but any update on this I am having the same issue keeps failing I have tried both bookworm 64bit and bullseye 64bit and have been unable to get this module working.

thanks in advanced

nischi commented 8 months ago

Hi all I tried now to install it from scratch and i strugle now also a little bit, specially with venv. I will keep you posted as i do have a solution.

grssll commented 8 months ago

@nischi Appreciate it.

nischi commented 8 months ago

@grssll I strugle now with the pipenv lock file. It's strange but they seems to update something with python and venv. I can skip it and then it works and i also updated the depenencies to opencv headless, which is kind of working. But need to check also with the real webcam.

So i installed the whole raspberry many times now and it seems to work, but didn't have time to test it till the end. If you have time and wanna test also a little you can try my branch.

https://github.com/nischi/MMM-Face-Reco-DNN/tree/bugfix/install-issues

Otherwise i will keep you postet if i successfully test everything.

grssll commented 8 months ago

Hi @nischi Will test tomorrow. Thanks

mikecheng2626 commented 8 months ago

@mikecheng2626 one can install node and npm system wide. but there are sometimes application conflicts between versions

another app was created nvm (node version manager) which allows you to select a version of node by command prompt and thus application

NVM is installed with apt-get

someone decide that the apt install is too restrictive on many platforms, so they created another new app, n , which is installed thru npm.

because my install script runs in many places, and has to deal with different collections of dependencies, aptget for another tool is difficult.

and the problems with node 18 and 20 using apt are impossible to resolve. I switched to using n.

both nvm and n install the version of node in /usr/local/bin, while apt installs in /usr/bin

/usr/local/bin is searched first..

if n is installed, u can see the versions available and which one is active. if started w sudo, you can change versions on the fly too

Thank you for your explanation. I will see into it.

marivan38 commented 8 months ago

this still seemed to fail for me .. maybe it's just me ... admin@rpi4-mm:~/MagicMirror/modules $ nvm install --lts Installing latest LTS version. Downloading and installing node v20.9.0... Downloading https://nodejs.org/dist/v20.9.0/node-v20.9.0-linux-arm64.tar.xz... ############################################################################################################################################################################################################## 100.0% Computing checksum with sha256sum Checksums matched! Now using node v20.9.0 (npm v10.1.0) Creating default alias: default -> lts/* (-> v20.9.0) admin@rpi4-mm:~/MagicMirror/modules $ node -v v20.9.0 admin@rpi4-mm:~/MagicMirror/modules $ sudo apt install python3-pip Reading package lists... Done Building dependency tree... Done Reading state information... Done python3-pip is already the newest version (20.3.4-4+rpt1+deb11u1). 0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded. admin@rpi4-mm:~/MagicMirror/modules $ sudo apt install pipenv Reading package lists... Done Building dependency tree... Done Reading state information... Done pipenv is already the newest version (11.9.0-1.1). 0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded. admin@rpi4-mm:~/MagicMirror/modules $ git clone https://github.com/nischi/MMM-Face-Reco-DNN.git Cloning into 'MMM-Face-Reco-DNN'... remote: Enumerating objects: 666, done. remote: Counting objects: 100% (309/309), done. remote: Compressing objects: 100% (120/120), done. remote: Total 666 (delta 241), reused 240 (delta 188), pack-reused 357 Receiving objects: 100% (666/666), 1.18 MiB | 3.08 MiB/s, done. Resolving deltas: 100% (412/412), done. admin@rpi4-mm:~/MagicMirror/modules $ cd MMM-Face-Reco-DNN npm install

mmm-face-reco-dnn@2.0.0 postinstall pipenv install --site-packages

Installing --site-packages… ⠋WARNING: Parse error at "'--site-p'": Expected W:(abcd...) ABORTING INSTALL... You will have to reinstall any packages that failed to install. You may have to manually run pipenv lock when you are finished. npm ERR! code 1 npm ERR! path /home/admin/MagicMirror/modules/MMM-Face-Reco-DNN npm ERR! command failed npm ERR! command sh -c pipenv install --site-packages

npm ERR! A complete log of this run can be found in: /home/admin/.npm/_logs/2023-10-25T02_11_50_567Z-debug-0.log admin@rpi4-mm:~/MagicMirror/modules/MMM-Face-Reco-DNN $ npm -v 10.1.0

nischi commented 8 months ago

Hi @marivan38 Seems you did not use my other branch where i'm testing. Because the install command is a little bit different. It is not yet deployed, i need to test it further. But who wants can use my branch https://github.com/nischi/MMM-Face-Reco-DNN/tree/bugfix/install-issues to test it as well

nischi commented 8 months ago

@grssll It took around 15 minutes to compile and install everything with the npm ci command. I tried on my raspberry pi 4