安装了 Python 依然提示错误 gyp ERR! find Python Python is not set from command line or npm configuration

2026-03-17 67 浏览 0 评论

没有安装 Python 会出现一大堆错误:

gyp info it worked if it ends with ok
gyp info using node-gyp@5.1.0
gyp info using node@14.19.0 | win32 | x64
gyp ERR! find Python
gyp ERR! find Python Python is not set from command line or npm configuration
gyp ERR! find Python Python is not set from environment variable PYTHON
gyp ERR! find Python checking if "python" can be used
gyp ERR! find Python - "python" is not in PATH or produced an error
gyp ERR! find Python checking if "python2" can be used
gyp ERR! find Python - "python2" is not in PATH or produced an error
gyp ERR! find Python checking if "python3" can be used
gyp ERR! find Python - "python3" is not in PATH or produced an error
gyp ERR! find Python checking if the py launcher can be used to find Python 2
gyp ERR! find Python - "py.exe" is not in PATH or produced an error
gyp ERR! find Python checking if Python is C:\Python27\python.exe
gyp ERR! find Python - "C:\Python27\python.exe" could not be run
gyp ERR! find Python checking if Python is C:\Python37\python.exe
gyp ERR! find Python - "C:\Python37\python.exe" could not be run
gyp ERR! find Python

我以为手动安装 Python 以后问题就解决了,但是结果还是一样的错误,现在只需要设置下 npm 的配置即可:

npm config set python "D:\Program Files\Python27\python.exe"

发布评论

发布评论前请先 登录
取消
0 评论
点赞
收藏

评论列表 0

暂无评论