[英]Compiling with python on CentOS 8 returns errors
I have installed the latest node, npm and python versions but get the following error when I try to install leveldown (using npm):我已经安装了最新的 node、npm 和 python 版本,但是当我尝试安装 leveldown(使用 npm)时出现以下错误:
> leveldown@2.1.1 install /root/apps/authentication/node_modules/leveldown
> prebuild-install || node-gyp rebuild
prebuild-install WARN install No prebuilt binaries found (target=10.16.3 runtime=node arch=x64 platform=linux)
gyp ERR! configure error
gyp ERR! stack Error: Command failed: /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 Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
gyp ERR! System Linux 4.18.0-80.11.2.el8_0.x86_64
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /root/apps/authentication/node_modules/leveldown
gyp ERR! node -v v10.16.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN auth@1.0.0 No description
npm WARN auth@1.0.0 No repository field.
npm WARN auth@1.0.0 No license field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! leveldown@2.1.1 install: `prebuild-install || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the leveldown@2.1.1 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! /root/.npm/_logs/2020-01-08T21_40_49_710Z-debug.log
It seems that python doesn't compile on CentOS 8... any help is welcome似乎 python 不能在 CentOS 8 上编译......欢迎任何帮助
FYI I'm not using directly leveldown but it's a dependency of PouchDB仅供参考,我没有直接使用 leveldown,但它是 PouchDB 的依赖项
You have installed Python 3 but you are running code that expects Python 2. You can install the python2
package and then you may be able to instruct your npm install process to use /usr/bin/python2
instead of /usr/bin/python
.您已经安装了 Python 3,但您正在运行需要 Python 2 的代码。您可以安装
python2
包,然后您可以指示您的 npm 安装过程使用/usr/bin/python2
而不是/usr/bin/python
。
If that's not possible, you should be able to symlink /usr/bin/python
to /usr/bin/python2
.如果这是不可能的,您应该能够将
/usr/bin/python
符号链接到/usr/bin/python2
。 By default, CentOS 8 doesn't have a /usr/bin/python
(it has only python2
or python3
commands), so this should be harmless.默认情况下,CentOS 8 没有
/usr/bin/python
(它只有python2
或python3
命令),所以这应该是无害的。
Note that Python 2 has just reached end of life .请注意,Python 2的生命周期刚刚结束。 Any software that still expects Python 2 at this point may not have seen updates in a while.
任何此时仍需要 Python 2 的软件可能已经有一段时间没有更新了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.