如何将 Google App Engine 更新到 Python 3.8
How to update Google App Engine to Python 3.8
当 运行ning python3 --version
为 3.7.3
时,我在 GAE 中的当前 Python 版本,我想将其升级到 3.8
以在GAE,我尝试将 service.yaml
中的 运行time 更改为 runtime: python38
,但版本在 3.7.3
中保持不变
当尝试 运行 sudo apt install python3.8
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package python3.8
E: Couldn't find any package by glob 'python3.8'
E: Couldn't find any package by regex 'python3.8'
yaml 文件
runtime: python38
entrypoint: gunicorn -w 8 -k uvicorn.workers.UvicornWorker servicename:app
instance_class: F4_1G
service: servicename
如何升级到 3.8
以使用此服务?
已解决,当使用 import sys print(sys.version)
打印文件内的版本时,我得到 3.8.6
,目录现在显示 /python3.8/
,谢谢大家。
Python3.8 App Engine(标准)运行时launched in Nov 2019. To access it, update your app.yaml
to have runtime: python38
. (Similarly, Python 3.9 launched in Mar 2021;同样的调整:runtime: python39
.)
上面的其他几个回复向您展示了如何检查您可以登录的 运行 版本等。在这里总结并添加更多内容,以便人们不必深入研究上面的评论:
>>> import site; site.getsitepackages()
['/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages']
>>>
>>> import sys; sys.version
'3.9.1 (v3.9.1:1e5d33e9b9, Dec 7 2020, 12:10:52) \n[Clang 6.0 (clang-600.0.57)]'
>>>
>>> import sys; sys.version_info.major, sys.version_info.minor
(3, 9)
>>>
>>> import platform; platform.python_version(), platform.python_version_tuple()
('3.9.1', ('3', '9', '1'))
当 运行ning python3 --version
为 3.7.3
时,我在 GAE 中的当前 Python 版本,我想将其升级到 3.8
以在GAE,我尝试将 service.yaml
中的 运行time 更改为 runtime: python38
,但版本在 3.7.3
当尝试 运行 sudo apt install python3.8
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package python3.8
E: Couldn't find any package by glob 'python3.8'
E: Couldn't find any package by regex 'python3.8'
yaml 文件
runtime: python38
entrypoint: gunicorn -w 8 -k uvicorn.workers.UvicornWorker servicename:app
instance_class: F4_1G
service: servicename
如何升级到 3.8
以使用此服务?
已解决,当使用 import sys print(sys.version)
打印文件内的版本时,我得到 3.8.6
,目录现在显示 /python3.8/
,谢谢大家。
Python3.8 App Engine(标准)运行时launched in Nov 2019. To access it, update your app.yaml
to have runtime: python38
. (Similarly, Python 3.9 launched in Mar 2021;同样的调整:runtime: python39
.)
上面的其他几个回复向您展示了如何检查您可以登录的 运行 版本等。在这里总结并添加更多内容,以便人们不必深入研究上面的评论:
>>> import site; site.getsitepackages()
['/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages']
>>>
>>> import sys; sys.version
'3.9.1 (v3.9.1:1e5d33e9b9, Dec 7 2020, 12:10:52) \n[Clang 6.0 (clang-600.0.57)]'
>>>
>>> import sys; sys.version_info.major, sys.version_info.minor
(3, 9)
>>>
>>> import platform; platform.python_version(), platform.python_version_tuple()
('3.9.1', ('3', '9', '1'))