问题
I'm using google cloud platform for my nodejs app. 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.
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 :
...
pygettext2.7
python
python2
python2.7
pyversions
...
Any idea how can I install python3 during the deployment of the app ? Maybe changing the app.yaml file ?
Thank you
回答1:
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.
Flex would also possibly work here, but Cloud Run will likely be significantly cheaper, have faster startup times, and can scale to zero.
来源:https://stackoverflow.com/questions/55829115/how-to-install-python3-in-google-cloud-platform-for-a-node-app