Q100610: Nuke 13 fails to launch with Python 3 syntax errors

Follow

SUMMARY

As of Nuke 13.0, Python 2 is no longer supported, and any Python scripts and integrations will need to be updated for Python 3 compatibility. This is due to the recent updates aligning Nuke 13 with VFX Reference platform 2020.


MORE INFORMATION

With the release of Nuke 13.0v1, the Python libraries have been updated to Python 3.7, whereas Nuke versions 12.2 and earlier were using Python 2.7 libraries. This may affect any Nuke users who have been using previous versions of Python code in their pipeline, including a failure to launch Nuke with syntax errors.

NOTE: As this is a big change for many users and companies, released maintenance releases for Nuke 12.2 will continue throughout 2021, to give users and developers more time to make all tools Python 3 compatible.
Nuke 12.2 maintenance releases are no longer going to be released as regularly, so we encourage all users to start moving your projects to the latest releases.


We would suggest updating any current Python scripts to be compatible with Python 3.7, and reach out to any of the third-party developers for updating their tools to be Python 3.7 compatible.

A good way to troubleshoot the issue is by launching Nuke in safe mode with the --safe flag on the command line. Additionally, it may be helpful to troubleshoot your .nuke directory for any incompatible Python scripts. More information on safe mode and the .nuke directory can be found in the Further Reading section below.

It is also possible to set Nuke to load different plug-in paths for different Nuke versions, which may help you transition to Nuke 13. Information about how to do that can be found here: Q100465: How to load plugins for different versions of Nuke.

One common change users have encountered in their code has been for the print command. Python 2 used the print command as print “your text here”, where Python 3 now requires parentheses as: print(“your text here”).

An example of this error can be seen in your Terminal/Command Prompt window:

SyntaxError: Missing parentheses in call to 'print'. Did you mean print("your text here")


You may also see an error dialog for the init.py or menu.py, similar to the following:

 

FURTHER READING

If you are still experiencing Python related issues when launching Nuke after trying the resolutions above, please open a Support request and let us know the exact issue encountered and the troubleshooting steps that have been taken.

For more information on how to open a Support request, please refer to this article: Q100064: How to raise a support ticket.

    We're sorry to hear that

    Please tell us why