适用于 Windows 和 Linux 的 Maya 随附了 Python 3 和 Python 2 解释器。适用于 MacOS 的 Maya 仅随附了 Python 3 解释器。
默认情况下,适用于 Windows 和 Linux 的 Maya 将以 Python 3 模式启动。通过从命令行启动 Maya 时使用 -pythonver 2 选项,或者在从命令行启动 Maya 之前将 MAYA_PYTHON_VERSION 环境变量设置为 2,可以切换到 Python 2 模式。
平台 | 命令 | 环境变量 |
---|---|---|
Windows | maya.exe -pythonver 2 | C:\>set MAYA_PYTHON_VERSION=2
C:\>maya.exe |
Linux | maya -pythonver 2 | [~]$ export MAYA_PYTHON_VERSION=2
[~]$ maya |