Syntax error while doing migrate

getting below error while doing migration.

Compiling Python Files...
Compiling ../apps/frappe/frappe/integrations/frappe_providers/ ...
  File "../apps/frappe/frappe/integrations/frappe_providers/", line 275
    print("Uploading files ({}/3)".format(x+1), end="\r")
SyntaxError: invalid syntax

Compiling ../apps/frappe/frappe/utils/ ...
  File "../apps/frappe/frappe/utils/", line 11
    req = requests.get(f"{org}/repos", {"type": "sources", "per_page": 200})
SyntaxError: invalid syntax

root@ip-172-31-16-156:/home/frappe/frappe-bench# SyntaxError: invalid syntax
SyntaxError:: command not found

The errors you are getting are because of a mismatch between the Python version that Frappe is expecting (3.6+), and your local Python environment.

The syntax shown in the errors were introduced / changed in the newer versions of Python, so you will have to upgrade your Python version to atleast 3.6 to move ahead.

and you’re logged in as “root” - NOT advisable

Is there any specific reason for not using root than permission?

I will PM you