我想将 python3.10 设置为默认 python。我想这样做是因为即使 yaml 文件具有有效的语法,我在运行 ansible 脚本时也会出错。
while scanning a simple key", key.mark,
yaml.scanner.ScannerError: while scanning a simple key
in "<unicode string>", line 16, column 1:
"
^
could not find expected ':'
in "<unicode string>", line 19, column 25:
这就是我的环境中的 python 符号链接。我在 Windows 10 上托管 Ubuntu 实例。
ls -l /usr/bin/python*
lrwxrwxrwx 1 root root 7 Apr 15 2020 /usr/bin/python -> python3
-rwxr-xr-x 1 root root 2555 Apr 14 2020 /usr/bin/python-argcomplete-check-easy-install-script3
-rwxr-xr-x 1 root root 314 Apr 14 2020 /usr/bin/python-argcomplete-tcsh3
lrwxrwxrwx 1 root root 9 Mar 13 2020 /usr/bin/python2 -> python2.7
-rwxr-xr-x 1 root root 3674216 Mar 8 2021 /usr/bin/python2.7
lrwxrwxrwx 1 root root 25 Jul 7 21:00 /usr/bin/python3 -> /etc/alternatives/python3
-rwxr-xr-x 1 root root 5793336 Jun 11 18:53 /usr/bin/python3.10
-rwxr-xr-x 1 root root 5490448 Mar 15 13:22 /usr/bin/python3.8