Help! Can't build engine from source

I’m trying to build UE 5.0.3 from source because I want to use a newer version of python for the python plugin, but I can’t because some of the code seems to be deprecated for python 3.10. What should I do?

From engine source:

I searched on google, and I found out that the red-squigglied parts are deprecated in python 3.10, but couldn’t find any replacements for them. What are they supposed to do or what can I change them into?

edit: from the official python 3.10 release notes: What’s New In Python 3.10 — Python 3.10.8 documentation they removed a whole bunch of functions including the squigglies above, But haven’t added back anything

There is no direct replacement for those calls in Python 3.10. Those APIs were undocumented and weren’t meant for external use and were therefore removed. The parser was rewritten in 3.10 and the notion of a concrete syntax tree no longer exists.

See this post for some additional details: Python 3.9.6 to 3.10.6 upgrade give pyarena methods error - Python Help - Discussions on Python.org

Ok, if there’s no direct replacements in python, are there any documents for this UE function Fpythonscriptplugin::Evalstring() so I can rewrite it myself? I can’t seem to find any. Thanks to your link, I think I can use Py_CompileStringExFlags() if I know where to put it.