How to Automatically Convert Python 2 to Python 3 for Maya

How to Automatically Convert Python 2 to Python 3 for Maya

Matias Codesal shows how you can convert Python 2 to Python 3 with the least fuss and still maintain backward-compatibility.

Maya 2022 launched with a couple of things set as default, like ACES and Python 3. The Python version changes is a necessary one as Python 2 was sunset on January 1st, 2020. Still, if you are not quite ready to switch over, you can set Maya to start in Python 2.

Changing all your scripts and modules over to Python 3 might be a little simpler than you’ve imagined, at least according to Matias Codesal. A new blog post from the technical director can help convert your code as fast as possible and with the least amount of strife. It also shows how you can keep backward-compatibility with Python 2.

“Python 3 includes a script called, 2to3.py, which handles automatically converting your code for a lot of the changes that occurred between Python 2 and Python 3.” Matias writes. 

See how to automatically convert to Python 3 there.

About Matias Codesal.

Matias is a Technical Director at DreamWorks Animation and teaches Scripting For Production at Gnomon School of Visual Effects, Games, and Animation. His skill set lies in creating pipelines, building custom applications, and integrating third-party applications.

Some of the links on lesterbanks are "affiliate links", a link with a special tracking code. This means if you click on an affiliate link and purchase the item, we will receive an affiliate commission. The price of the item is the same whether it is an affiliate link or not. Regardless, we only recommend products or services we believe will add value to our readers. By using the affiliate links, you are helping support our Website, and we genuinely appreciate your support.