[英]How to install Python3 in Google Cloud Platform for a Node app
I'm using google cloud platform for my nodejs app. 我正在使用谷歌云平台为我的nodejs应用程序。 Problem, after deploying the app i have access to python2.7 but not to the version 3. This one seems to be missing in the usr/bin folder. 问题,在部署应用程序后,我可以访问python2.7但不能访问版本3.这个似乎在usr / bin文件夹中缺失。
const spawn = require("child_process").spawn;
spawn('python'); // working
spawn('/usr/bin/python3'); // not working
spawn('python3'); // not working
Error: spawn python3 ENOENT
I used fs module to display the usr/bin folder : 我用fs模块显示usr / bin文件夹:
...
pygettext2.7
python
python2
python2.7
pyversions
...
Any idea how can I install python3 during the deployment of the app ? 任何想法如何在部署应用程序期间安装python3? Maybe changing the app.yaml file ? 也许更改app.yaml文件?
Thank you 谢谢
If you need a runtime that has both a specific version of Node.js and Python, you'd probably be better off using Cloud Run and specifying a custom image instead of trying to use one language inside another's runtime. 如果您需要一个同时具有特定版本的Node.js和Python的运行时,您可能最好使用Cloud Run并指定自定义映像,而不是尝试在另一个运行时内使用一种语言。
Flex would also possibly work here, but Cloud Run will likely be significantly cheaper, have faster startup times, and can scale to zero. Flex也可能在这里工作,但Cloud Run可能会更便宜,启动时间更短,并且可以扩展到零。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.