最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

无法在Mac上安装节点TA

运维笔记admin7浏览0评论

无法在Mac上安装节点TA

无法在Mac上安装节点TA

我正在尝试在特定目录中安装节点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! [email protected] install: `node ./src/lib/build.js && node-gyp configure && node-gyp build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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有关,因为Python3破坏了向后兼容性(有关更多信息,请参见how to change default python version?),因此python从版本2更改为版本3。

我通过打开OS X终端窗口解决了:

$ 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创建一个符号链接,作为您的默认python解释器,从而恢复兼容性。

现在,我能够毫无问题地安装节点talib。

我希望它也对您有用。

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论