When I try to install TensorFlow in node red i got the following error.I tried different way to install but not succeed


2023-10-26T12:21:11.608Z Install : node-red-contrib-tensorflow 0.4.2

-----------------------------------------------------------

2023-10-26T12:21:34.063Z Install : node-red-contrib-tensorflow 0.4.2

2023-10-26T12:21:34.090Z npm.cmd install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict node-red-contrib-tensorflow@0.4.2

2023-10-26T12:21:35.223Z [err] npm

2023-10-26T12:21:35.223Z [err] WARN

2023-10-26T12:21:35.224Z [err] config production Use `--omit=dev` instead.

-----------------------------------------------------------

2023-10-26T12:22:00.690Z Install : node-red-contrib-tf-model 0.1.12

2023-10-26T12:22:02.137Z [err] npm

2023-10-26T12:22:02.137Z [err] WARN deprecated request-promise@4.2.6: request-promise has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142

2023-10-26T12:22:02.164Z [err] npm WARN

2023-10-26T12:22:02.165Z [err] deprecated har-validator@5.1.5: this library is no longer supported

2023-10-26T12:22:02.969Z [err] npm

2023-10-26T12:22:02.970Z [err] WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.

2023-10-26T12:22:02.991Z [err] npm

2023-10-26T12:22:02.992Z [err]

2023-10-26T12:22:02.992Z [err] WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142

-----------------------------------------------------------

2023-10-26T12:22:05.890Z Install : node-red-contrib-tfjs-coco-ssd 1.0.6

2023-10-26T12:22:28.176Z [err] npm ERR! code

2023-10-26T12:22:28.177Z [err] 1

2023-10-26T12:22:28.177Z [err] npm ERR! path C:\Users\Antara\.node-red\node_modules\@tensorflow\tfjs-node

2023-10-26T12:22:28.181Z [err] npm ERR! command failed

2023-10-26T12:22:28.181Z [err] npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node scripts/install.js

2023-10-26T12:22:28.182Z [err] npm ERR! CPU-windows-4.1.0.zip

2023-10-26T12:22:28.182Z [err] npm ERR! https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-windows-x86_64-2.9.1.zip

2023-10-26T12:22:28.182Z [err] npm ERR! node-pre-gyp install failed with error: Error: Command failed: node-pre-gyp install --fallback-to-build

2023-10-26T12:22:28.182Z [err] npm ERR! node-pre-gyp info it worked if it ends with ok

2023-10-26T12:22:28.182Z [err] npm

2023-10-26T12:22:28.182Z [err] ERR! node-pre-gyp info using node-pre-gyp@1.0.9

2023-10-26T12:22:28.182Z [err] npm ERR! node-pre-gyp info using node@20.9.0 | win32 | x64

2023-10-26T12:22:28.182Z [err] npm ERR! node-pre-gyp info check checked for "C:\Users\Antara\.node-red\node_modules\@tensorflow\tfjs-node\lib\napi-v8\tfjs_binding.node" (not found)

2023-10-26T12:22:28.182Z [err] npm ERR! node-pre-gyp http GET https://storage.googleapis.com/tf-builds/pre-built-binary/napi-v8/4.1.0/CPU-windows-4.1.0.zip

2023-10-26T12:22:28.182Z [err] npm ERR! node-pre-gyp ERR! install response status 404 Not Found on https://storage.googleapis.com/tf-builds/pre-built-binary/napi-v8/4.1.0/CPU-windows-4.1.0.zip

2023-10-26T12:22:28.182Z [err] npm ERR!

2023-10-26T12:22:28.182Z [err] node-pre-gyp WARN Pre-built binaries not installable for @tensorflow/tfjs-node@4.1.0 and node@20.9.0 (node-v115 ABI, unknown) (falling back to source compile with node-gyp)

2023-10-26T12:22:28.182Z [err] npm ERR! node-pre-gyp WARN Hit error response status 404 Not Found on https://storage.googleapis.com/tf-builds/pre-built-binary/napi-v8/4.1.0/CPU-windows-4.1.0.zip

2023-10-26T12:22:28.182Z [err] npm ERR! gyp info it worked if it ends with ok

2023-10-26T12:22:28.182Z [err] npm

2023-10-26T12:22:28.183Z [err] ERR! gyp info using node-gyp@9.4.0

2023-10-26T12:22:28.183Z [err] npm ERR! gyp info using node@20.9.0 | win32 | x64

2023-10-26T12:22:28.183Z [err] npm

2023-10-26T12:22:28.183Z [err] ERR! gyp info ok

2023-10-26T12:22:28.183Z [err] npm ERR! gyp info it worked if it ends with ok

2023-10-26T12:22:28.183Z [err] npm ERR!

2023-10-26T12:22:28.183Z [err] gyp info using node-gyp@9.4.0

2023-10-26T12:22:28.183Z [err] npm ERR! gyp info using node@20.9.0 | win32 | x64

2023-10-26T12:22:28.183Z [err] npm ERR! gyp ERR! find Python

2023-10-26T12:22:28.184Z [err] npm ERR! gyp ERR! find Python Python is not set from command line or npm configuration

2023-10-26T12:22:28.184Z [err] npm ERR! gyp ERR! find Python Python is not set from environment variable PYTHON

2023-10-26T12:22:28.184Z [err] npm

2023-10-26T12:22:28.184Z [err] ERR! gyp ERR! find Python checking if "python3" can be used

2023-10-26T12:22:28.184Z [err] npm ERR! gyp ERR! find Python - "python3" is not in PATH or produced an error

2023-10-26T12:22:28.184Z [err] npm

2023-10-26T12:22:28.184Z [err] ERR! gyp ERR! find Python checking if "python" can be used

2023-10-26T12:22:28.184Z [err] npm ERR! gyp ERR! find Python - "python" is not in PATH or produced an error

2023-10-26T12:22:28.184Z [err] npm ERR! gyp ERR! find Python checking if Python is C:\Users\Antara\AppData\Local\Programs\Python\Python39\python.exe

2023-10-26T12:22:28.184Z [err] npm ERR!

2023-10-26T12:22:28.185Z [err] gyp ERR! find Python - "C:\Users\Antara\AppData\Local\Programs\Python\Python39\python.exe" could not be run

2023-10-26T12:22:28.185Z [err] npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python39\python.exe

2023-10-26T12:22:28.185Z [err] npm

2023-10-26T12:22:28.185Z [err] ERR! gyp ERR! find Python - "C:\Program Files\Python39\python.exe" could not be run

2023-10-26T12:22:28.185Z [err] npm ERR! gyp ERR! find Python checking if Python is C:\Users\Antara\AppData\Local\Programs\Python\Python39-32\python.exe

2023-10-26T12:22:28.185Z [err] npm ERR! gyp ERR! find Python - "C:\Users\Antara\AppData\Local\Programs\Python\Python39-32\python.exe" could not be run

2023-10-26T12:22:28.185Z [err] npm ERR!

2023-10-26T12:22:28.185Z [err] gyp ERR! find Python checking if Python is C:\Program Files\Python39-32\python.exe

2023-10-26T12:22:28.185Z [err] npm ERR! gyp ERR! find Python - "C:\Program Files\Python39-32\python.exe" could not be run

2023-10-26T12:22:28.185Z [err] npm ERR!

2023-10-26T12:22:28.185Z [err] gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python39-32\python.exe

2023-10-26T12:22:28.185Z [err] npm ERR! gyp ERR! find Python - "C:\Program Files (x86)\Python39-32\python.exe" could not be run

2023-10-26T12:22:28.185Z [err] npm

2023-10-26T12:22:28.186Z [err] ERR! gyp ERR! find Python checking if Python is C:\Users\Antara\AppData\Local\Programs\Python\Python38\python.exe

2023-10-26T12:22:28.186Z [err] npm ERR! gyp ERR! find Python - "C:\Users\Antara\AppData\Local\Programs\Python\Python38\python.exe" could not be run

2023-10-26T12:22:28.186Z [err] npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python38\python.exe

2023-10-26T12:22:28.186Z [err] npm ERR!

2023-10-26T12:22:28.186Z [err] gyp ERR! find Python - "C:\Program Files\Python38\python.exe" could not be run

2023-10-26T12:22:28.186Z [err] npm ERR! gyp ERR! find Python checking if Python is C:\Users\Antara\AppData\Local\Programs\Python\Python38-32\python.exe

2023-10-26T12:22:28.186Z [err] npm

2023-10-26T12:22:28.186Z [err] ERR! gyp ERR! find Python - "C:\Users\Antara\AppData\Local\Programs\Python\Python38-32\python.exe" could not be run

2023-10-26T12:22:28.186Z [err] npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python38-32\python.exe

2023-10-26T12:22:28.186Z [err] npm

2023-10-26T12:22:28.186Z [err] ERR! gyp ERR! find Python - "C:\Program Files\Python38-32\python.exe" could not be run

2023-10-26T12:22:28.186Z [err] npm ERR! gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python38-32\python.exe

2023-10-26T12:22:28.186Z [err] npm

2023-10-26T12:22:28.187Z [err] ERR! gyp ERR! find Python - "C:\Program Files (x86)\Python38-32\python.exe" could not be run

2023-10-26T12:22:28.187Z [err] npm ERR!

2023-10-26T12:22:28.187Z [err] gyp ERR! find Python checking if Python is C:\Users\Antara\AppData\Local\Programs\Python\Python37\python.exe

2023-10-26T12:22:28.187Z [err] npm ERR! gyp ERR! find Python - "C:\Users\Antara\AppData\Local\Programs\Python\Python37\python.exe" could not be run

2023-10-26T12:22:28.187Z [err] npm

2023-10-26T12:22:28.187Z [err] ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python37\python.exe

2023-10-26T12:22:28.187Z [err] npm ERR!

2023-10-26T12:22:28.187Z [err] gyp ERR! find Python - "C:\Program Files\Python37\python.exe" could not be run

2023-10-26T12:22:28.187Z [err] npm ERR! gyp ERR! find Python checking if Python is C:\Users\Antara\AppData\Local\Programs\Python\Python37-32\python.exe

2023-10-26T12:22:28.187Z [err] npm ERR! gyp ERR! find Python - "C:\Users\Antara\AppData\Local\Programs\Python\Python37-32\python.exe" could not be run

2023-10-26T12:22:28.187Z [err] npm

2023-10-26T12:22:28.188Z [err] ERR!

2023-10-26T12:22:28.188Z [err] gyp ERR! find Python checking if Python is C:\Program Files\Python37-32\python.exe

2023-10-26T12:22:28.188Z [err] npm

2023-10-26T12:22:28.188Z [err] ERR! gyp ERR! find Python - "C:\Program Files\Python37-32\python.exe" could not be run

2023-10-26T12:22:28.188Z [err] npm ERR! gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python37-32\python.exe

2023-10-26T12:22:28.188Z [err] npm ERR!

2023-10-26T12:22:28.189Z [err] gyp ERR! find Python - "C:\Program Files (x86)\Python37-32\python.exe" could not be run

2023-10-26T12:22:28.189Z [err] npm ERR! gyp ERR! find Python checking if Python is C:\Users\Antara\AppData\Local\Programs\Python\Python36\python.exe

2023-10-26T12:22:28.189Z [err] npm ERR! gyp ERR! find Python - "C:\Users\Antara\AppData\Local\Programs\Python\Python36\python.exe" could not be run

2023-10-26T12:22:28.189Z [err] npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python36\python.exe

2023-10-26T12:22:28.189Z [err] npm ERR! gyp ERR! find Python - "C:\Program Files\Python36\python.exe" could not be run

2023-10-26T12:22:28.189Z [err] npm ERR!

2023-10-26T12:22:28.189Z [err] gyp ERR! find Python checking if Python is C:\Users\Antara\AppData\Local\Programs\Python\Python36-32\python.exe

2023-10-26T12:22:28.189Z [err] npm ERR! gyp ERR! find Python - "C:\Users\Antara\AppData\Local\Programs\Python\Python36-32\python.exe" could not be run

2023-10-26T12:22:28.189Z [err] npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python36-32\python.exe

2023-10-26T12:22:28.189Z [err] npm ERR!

2023-10-26T12:22:28.190Z [err] gyp ERR! find Python - "C:\Program Files\Python36-32\python.exe" could not be run

2023-10-26T12:22:28.190Z [err] npm ERR! gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python36-32\python.exe

2023-10-26T12:22:28.190Z [err] npm ERR! gyp ERR! find Python - "C:\Program Files (x86)\Python36-32\python.exe" could not be run

2023-10-26T12:22:28.190Z [err] npm

2023-10-26T12:22:28.190Z [err] ERR! gyp ERR! find Python checking if the py launcher can be used to find Python 3

2023-10-26T12:22:28.190Z [err] npm ERR! gyp ERR! find Python - "py.exe" is not in PATH or produced an error

2023-10-26T12:22:28.190Z [err] npm ERR!

2023-10-26T12:22:28.190Z [err] gyp ERR! find Python

2023-10-26T12:22:28.190Z [err] npm ERR! gyp ERR! find Python **********************************************************

2023-10-26T12:22:28.190Z [err] npm ERR! gyp ERR! find Python You need to install the latest version of Python.

2023-10-26T12:22:28.190Z [err] npm ERR! gyp ERR! find Python Node-gyp should be able to find and use Python. If not,

2023-10-26T12:22:28.190Z [err] npm ERR! gyp ERR! find Python you can try one of the following options:

2023-10-26T12:22:28.190Z [err] npm

2023-10-26T12:22:28.190Z [err] ERR! gyp ERR! find Python - Use the switch --python="C:\Path\To\python.exe"

2023-10-26T12:22:28.190Z [err] npm ERR! gyp ERR! find Python (accepted by both node-gyp and npm)

2023-10-26T12:22:28.190Z [err] npm

2023-10-26T12:22:28.190Z [err] ERR! gyp ERR! find Python - Set the environment variable PYTHON

2023-10-26T12:22:28.190Z [err] npm ERR! gyp ERR! find Python - Set the npm configuration variable python:

2023-10-26T12:22:28.190Z [err] npm

2023-10-26T12:22:28.190Z [err] ERR! gyp ERR! find Python npm config set python "C:\Path\To\python.exe"

2023-10-26T12:22:28.190Z [err] npm ERR! gyp ERR! find Python For more information consult the documentation at:

2023-10-26T12:22:28.190Z [err] npm ERR!

2023-10-26T12:22:28.190Z [err] gyp ERR! find Python https://github.com/nodejs/node-gyp#installation

2023-10-26T12:22:28.190Z [err] npm ERR! gyp ERR! find Python **********************************************************

2023-10-26T12:22:28.190Z [err] npm ERR!

2023-10-26T12:22:28.190Z [err] gyp ERR! find Python

2023-10-26T12:22:28.190Z [err] npm ERR! gyp ERR! configure error

2023-10-26T12:22:28.190Z [err] npm ERR!

2023-10-26T12:22:28.190Z [err] gyp ERR! stack Error: Could not find any Python installation to use

2023-10-26T12:22:28.190Z [err] npm ERR! gyp ERR! stack at PythonFinder.fail (C:\Users\Antara\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-python.js:330:47)

2023-10-26T12:22:28.190Z [err] npm ERR!

2023-10-26T12:22:28.190Z [err] gyp ERR! stack at PythonFinder.runChecks (C:\Users\Antara\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-python.js:159:21)

2023-10-26T12:22:28.190Z [err] npm ERR! gyp ERR! stack at PythonFinder.<anonymous> (C:\Users\Antara\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-python.js:228:18)

2023-10-26T12:22:28.190Z [err] npm ERR!

2023-10-26T12:22:28.191Z [err] gyp ERR! stack at PythonFinder.execFileCallback (C:\Users\Antara\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-python.js:294:16)

2023-10-26T12:22:28.191Z [err] npm ERR! gyp ERR! stack at ChildProcess.exithandler (node:child_process:430:5)

2023-10-26T12:22:28.191Z [err] npm ERR!

2023-10-26T12:22:28.191Z [err] gyp ERR! stack at ChildProcess.emit (node:events:514:28)

2023-10-26T12:22:28.191Z [err] npm ERR! gyp ERR! stack at maybeClose (node:internal/child_process:1105:16)

2023-10-26T12:22:28.191Z [err] npm ERR!

2023-10-26T12:22:28.191Z [err] gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:305:5)

2023-10-26T12:22:28.191Z [err] npm ERR! gyp ERR! System Windows_NT 10.0.19045

2023-10-26T12:22:28.191Z [err] npm ERR!

2023-10-26T12:22:28.191Z [err] gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Antara\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\\Users\\Antara\\.node-red\\node_modules\\@tensorflow\\tfjs-node\\lib\\napi-v8\\tfjs_binding.node" "--module_name=tfjs_binding" "--module_path=C:\\Users\\Antara\\.node-red\\node_modules\\@tensorflow\\tfjs-node\\lib\\napi-v8" "--napi_version=9" "--node_abi_napi=napi" "--napi_build_version=8" "--node_napi_label=napi-v8"

2023-10-26T12:22:28.191Z [err] npm ERR! gyp ERR! cwd C:\Users\Antara\.node-red\node_modules\@tensorflow\tfjs-node

2023-10-26T12:22:28.191Z [err] npm ERR! gyp ERR! node -v v20.9.0

2023-10-26T12:22:28.191Z [err] npm ERR! gyp ERR! node-gyp -v v9.4.0

2023-10-26T12:22:28.191Z [err] npm ERR! gyp ERR! not ok

2023-10-26T12:22:28.191Z [err] npm

2023-10-26T12:22:28.191Z [err] ERR! node-pre-gyp ERR! build error

2023-10-26T12:22:28.191Z [err] npm ERR! node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\Antara\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\Antara\.node-red\node_modules\@tensorflow\tfjs-node\lib\napi-v8\tfjs_binding.node --module_name=tfjs_binding --module_path=C:\Users\Antara\.node-red\node_modules\@tensorflow\tfjs-node\lib\napi-v8 --napi_version=9 --node_abi_napi=napi --napi_build_version=8 --node_napi_label=napi-v8' (1)

2023-10-26T12:22:28.191Z [err] npm

2023-10-26T12:22:28.191Z [err] ERR! node-pre-gyp ERR! stack at ChildProcess.<anonymous> (C:\Users\Antara\.node-red\node_modules\@mapbox\node-pre-gyp\lib\util\compile.js:89:23)

2023-10-26T12:22:28.191Z [err] npm ERR! node-pre-gyp ERR! stack at ChildProcess.emit (node:events:514:28)

2023-10-26T12:22:28.191Z [err] npm

2023-10-26T12:22:28.191Z [err] ERR! node-pre-gyp ERR! stack at maybeClose (node:internal/child_process:1105:16)

2023-10-26T12:22:28.191Z [err] npm ERR! node-pre-gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:305:5)

2023-10-26T12:22:28.191Z [err] npm

2023-10-26T12:22:28.191Z [err] ERR! node-pre-gyp ERR! System Windows_NT 10.0.19045

2023-10-26T12:22:28.191Z [err] npm ERR! node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Antara\\.node-red\\node_modules\\@mapbox\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"

2023-10-26T12:22:28.191Z [err] npm

2023-10-26T12:22:28.191Z [err] ERR! node-pre-gyp ERR! cwd C:\Users\Antara\.node-red\node_modules\@tensorflow\tfjs-node

2023-10-26T12:22:28.191Z [err] npm ERR! node-pre-gyp ERR! node -v v20.9.0

2023-10-26T12:22:28.191Z [err] npm ERR!

2023-10-26T12:22:28.191Z [err] node-pre-gyp ERR! node-pre-gyp -v v1.0.9

2023-10-26T12:22:28.191Z [err] npm ERR! node-pre-gyp ERR! not ok

2023-10-26T12:22:28.192Z [err] npm ERR! * Downloading libtensorflow

2023-10-26T12:22:28.192Z [err] npm ERR!

2023-10-26T12:22:28.192Z [err] npm ERR! * Building TensorFlow Node.js bindings

2023-10-26T12:22:28.195Z [err]

2023-10-26T12:22:28.195Z [err] npm ERR! A complete log of this run can be found in: C:\Users\Antara\AppData\Local\npm-cache\_logs\2023-10-26T12_21_35_169Z-debug-0.log

2023-10-26T12:22:28.266Z rc=1

}
1 Like

I am on my phone so it is difficult to read the log, but it seems clear that one of the problems is that Python is not installed.

Python v 2.7 is already installed

What OS and hardware is node-red running on?
What does this command show?
python --version

Does it install if you go into your .node-red folder (that is important) and run
npm install node-red-contrib-tfjs-coco-ssd
If not then post the full output from that command.

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.