[英]Can't run python cmd command. Throws syntax error
我正在使用node-gyp configure
因为前端项目需要这个。 我正在使用 Windows 10,整个过程都崩溃了。
这是错误消息:
$ node-gyp rebuild
gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@10.20.1 | win32 | x64
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:\Users\xetra11\AppData\Local\Programs\Python\Python37\python.EXE -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 Windows_NT 10.0.18363
我试图重现 python 问题:
$ python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
File "<string>", line 1
import
^
SyntaxError: invalid syntax
Unable to initialize device PRN
Python版本是3.7.1
知道如何解决这个问题吗? 我需要降级我的 python 版本还是什么?
python 版本的 3.x 中的打印需求(“文本”,or_variable)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.