python - 节点 gyp 重建失败:错误:命令失败:节点 gyp 重建
问题描述
我正在尝试tensorflow
为节点安装,似乎npm i @tensorflow/tfjs-node
应该完成工作,但我遇到了这个与 python 有关的奇怪问题。前段时间我确实安装了 python,但我对此几乎一无所知。
@tensorflow/tfjs-node@0.1.17 install C:\tf\node_modules\@tensorflow\tfjs-node
> node scripts/install.js
* Downloading libtensorflow
[==============================] 1479154/bps 100% 0.0s
* Building TensorFlow Node.js bindings
C:\tf\node_modules\@tensorflow\tfjs-node\scripts\install.js:154
throw new Error('node-gyp rebuild failed with: ' + err);
^
Error: node-gyp rebuild failed with: Error: Command failed: node-gyp rebuild
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "C:/Anaconda/python", you can set the PYTHON env variable.
gyp ERR! stack at PythonFinder.failNoPython (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:483:19)
gyp ERR! stack at PythonFinder.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:508:16)
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:152:21)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\tf\node_modules\@tensorflow\tfjs-node
gyp ERR! node -v v8.11.4
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
at cp.exec (C:\tf\node_modules\@tensorflow\tfjs-node\scripts\install.js:154:13)
at ChildProcess.exithandler (child_process.js:282:5)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:925:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
npm WARN knn-tf@1.0.0 No description
npm WARN knn-tf@1.0.0 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @tensorflow/tfjs-node@0.1.17 install: `node scripts/install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @tensorflow/tfjs-node@0.1.17 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Paras\AppData\Roaming\npm-cache\_logs\2019-01-19T17_31_39_415Z-debug.log
解决方案
推荐阅读
- xslt - 获取动态子字符串 xslt
- python-3.x - 为熊猫数据框中的单元格设置值
- mysql - Kubernetes entrypoint.sh 中的 Mariadb 10.4 在临时服务器上失败
- android - 如何尝试在获取数据中成功捕获 val?
- java - 如何通过向超类构造函数添加参数来在 Java 中构建构造函数?
- javascript - 将 Async/Await 与 Array.map 一起使用
- c# - 使用 C# 上的 SqlClient 获取列是否可为空(声明为非空或隐式声明为空)
- java - TagesdienstC.jar 中没有主清单属性
- .net - 寻找适用于 async/await 的 Reader Writer Lock
- javascript - 赛普拉斯测试因断言等于 DOM 标题而失败