无法在 mac 上安装节点 TA-LIB
Unable to install node TA-LIB on mac
我正在尝试在特定目录中安装节点 talib,但我不断收到以下错误消息:
gyp ERR! configure error
gyp ERR! stack Error: Command failed: /Users/martijnbeeks/anaconda3/bin/python -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack File "<string>", line 1
gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack at ChildProcess.exithandler (child_process.js:294:12)
gyp ERR! stack at ChildProcess.emit (events.js:198:13)
gyp ERR! stack at maybeClose (internal/child_process.js:982:16)
gyp ERR! stack at Socket.stream.socket.on (internal/child_process.js:389:11)
gyp ERR! stack at Socket.emit (events.js:198:13)
gyp ERR! stack at Pipe._handle.close (net.js:606:12)
gyp ERR! System Darwin 18.7.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure"
gyp ERR! cwd /Users/martijnbeeks/ProjectY/gekko-develop/talib
gyp ERR! node -v v10.16.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! talib@1.1.2 install: `node ./src/lib/build.js && node-gyp configure && node-gyp build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the talib@1.1.2 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:
有谁知道我做错了什么?我以某种方式认为它会干扰 Python 并且我完全删除了 Python 但它仍然无法正常工作。我有 node.js 版本 v10.16.3 和 Python 3.7.4。
提前致谢,
马丁
我在这里遇到了同样的问题。
我发现它与默认 OS X python 已从版本 2 更改为版本 3 有关,因为 Python3 破坏了向后兼容性(有关更多信息,请参阅 how to change default python version?)。
我通过打开 OS X 终端 window:
解决了它
$ which python
/usr/local/bin/python
$ /usr/local/bin/python -V
Python 3.7.1
$ which python2.7
/usr/bin/python2.7
$ rm /usr/local/bin/python
$ ln -s /usr/bin/python2.7 /usr/local/bin/python
这将为 python2 创建一个符号 link 作为您的默认 python 解释器,恢复兼容性。
现在我可以毫无问题地安装 node talib。
我希望它也对你有用。
我正在尝试在特定目录中安装节点 talib,但我不断收到以下错误消息:
gyp ERR! configure error
gyp ERR! stack Error: Command failed: /Users/martijnbeeks/anaconda3/bin/python -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack File "<string>", line 1
gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack at ChildProcess.exithandler (child_process.js:294:12)
gyp ERR! stack at ChildProcess.emit (events.js:198:13)
gyp ERR! stack at maybeClose (internal/child_process.js:982:16)
gyp ERR! stack at Socket.stream.socket.on (internal/child_process.js:389:11)
gyp ERR! stack at Socket.emit (events.js:198:13)
gyp ERR! stack at Pipe._handle.close (net.js:606:12)
gyp ERR! System Darwin 18.7.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure"
gyp ERR! cwd /Users/martijnbeeks/ProjectY/gekko-develop/talib
gyp ERR! node -v v10.16.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! talib@1.1.2 install: `node ./src/lib/build.js && node-gyp configure && node-gyp build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the talib@1.1.2 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:
有谁知道我做错了什么?我以某种方式认为它会干扰 Python 并且我完全删除了 Python 但它仍然无法正常工作。我有 node.js 版本 v10.16.3 和 Python 3.7.4。
提前致谢,
马丁
我在这里遇到了同样的问题。 我发现它与默认 OS X python 已从版本 2 更改为版本 3 有关,因为 Python3 破坏了向后兼容性(有关更多信息,请参阅 how to change default python version?)。
我通过打开 OS X 终端 window:
解决了它$ which python
/usr/local/bin/python
$ /usr/local/bin/python -V
Python 3.7.1
$ which python2.7
/usr/bin/python2.7
$ rm /usr/local/bin/python
$ ln -s /usr/bin/python2.7 /usr/local/bin/python
这将为 python2 创建一个符号 link 作为您的默认 python 解释器,恢复兼容性。
现在我可以毫无问题地安装 node talib。
我希望它也对你有用。