mac安装web3出错

方法一:pip3 install web3 错误提示如下: ERROR: Could not find a version that satisfies the requirement ipfshttpclient==0.7.0a1 (from web3) (from versions: 0.4.10, 0.4.11, 0.4.12, 0.4.13, 0.4.13.1, 0.4.13.2, 0.6.0, 0.6.0.post1, 0.6.1) ERROR: No matching distribution found for ipfshttpclient==0.7.0a1 (from web3)

方法二:npm install web3

bufferutil@4.0.2 install /Users/priest/node_modules/bufferutil node-gyp-build

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

Traceback (most recent call last): File "/Users/priest/.nvm/versions/node/v8.5.0/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 16, in <module> sys.exit(gyp.script_main()) File "/Users/priest/.nvm/versions/node/v8.5.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/init.py", line 545, in script_main return main(sys.argv[1:]) File "/Users/priest/.nvm/versions/node/v8.5.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/init.py", line 538, in main return gyp_main(args) File "/Users/priest/.nvm/versions/node/v8.5.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/init.py", line 523, in gyp_main generator.GenerateOutput(flat_list, targets, data, params) File "/Users/priest/.nvm/versions/node/v8.5.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 2170, in GenerateOutput part_of_all=qualified_target in needed_targets) File "/Users/priest/.nvm/versions/node/v8.5.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 795, in Write self.Pchify)) File "/Users/priest/.nvm/versions/node/v8.5.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 1190, in WriteSources cflags = self.xcode_settings.GetCflags(configname) File "/Users/priest/.nvm/versions/node/v8.5.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 551, in GetCflags archs = self.GetActiveArchs(self.configname) File "/Users/priest/.nvm/versions/node/v8.5.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 420, in GetActiveArchs xcode_archs_default = GetXcodeArchsDefault() File "/Users/priest/.nvm/versions/node/v8.5.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 118, in GetXcodeArchsDefault xcodeversion, = XcodeVersion() File "/Users/priest/.nvm/versions/node/v8.5.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 1265, in XcodeVersion version = re.match(r'(\d.\d.?\d*)', version).groups()[0] AttributeError: 'NoneType' object has no attribute 'groups' gyp ERR! configure error gyp ERR! stack Error: gyp failed with exit code: 1 gyp ERR! stack at ChildProcess.onCpExit (/Users/priest/.nvm/versions/node/v8.5.0/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:336:16) gyp ERR! stack at emitTwo (events.js:125:13) gyp ERR! stack at ChildProcess.emit (events.js:213:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12) gyp ERR! System Darwin 18.2.0 gyp ERR! command "/Users/priest/.nvm/versions/node/v8.5.0/bin/node" "/Users/priest/.nvm/versions/node/v8.5.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /Users/priest/node_modules/bufferutil gyp ERR! node -v v8.5.0 gyp ERR! node-gyp -v v3.6.2 gyp ERR! not ok npm WARN enoent ENOENT: no such file or directory, open '/Users/priest/package.json' npm WARN priest No description npm WARN priest No repository field. npm WARN priest No README data npm WARN priest No license field.

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! bufferutil@4.0.2 install: node-gyp-build npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the bufferutil@4.0.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: npm ERR! /Users/priest/.npm/_logs/2020-11-26T13_26_43_138Z-debug.log

求高手解答。 我在2017版mac下没有任何问题 现在换到一台2014版的mac就出现以上问题。

请先 登录 后评论

最佳答案 2020-11-28 12:42

搞定了! 1.清空了node.js和npm,重新安装到最新版本。 2.升级Python3到最新版本。 最后还是用pip安装成功。 pip install web3

请先 登录 后评论

其它 1 个回答

Tiny熊
  擅长:智能合约,以太坊
请先 登录 后评论
  • 2 关注
  • 0 收藏,3638 浏览
  • Priest 提出于 2020-11-26 21:40