写在前面: 网上信息繁杂,有一点 完整 且 有用 的信息都没有,最后在Stack Overflow拼凑出。
1.
apt install 2to3
apt install python3-lib2to3
apt install python3-toolz
2.
Check if you have the file /usr/bin/2to3-2.7 (or similar). If one exists, then simply create a symbolic link to it with a link name of 2to3 (e.g.: ln -s 2to3-2.7 /usr/bin/2to3)
3. 把dir目录中的.py全部转换
2to3 -w dir