Shotgun Python API v3.1.0 released -- Python 3 support!

Hey everyone,

We’re happy to announce that we’ve released v3.1.0 of Shotgun’s Python API! This release adds support for Python 3, while maintaining compatibility with Python 2.x.

With the VFX Reference Platform’s CY2020 mandating the use of Python 3.7.x, we are expecting to see content creation software embedding Python 3 in the very near future. This is our first step towards supporting those forthcoming releases, with more to come in the future as we move our attention to Toolkit.

As always, feel free to reach out to our support team if you have any questions or concerns!

20 Likes

For those of you new to Shotgun who might not already be using the Python API, see the documentation linked here!

4 Likes

those docs are awesome :wink:

5 Likes

Hi,

I was trying to install for Python 3.7 but it does not actually work, the vendored xmlrpclib.py module is for Python 2: https://github.com/shotgunsoftware/python-api/issues/227

I’m honestly extremely surprised that this has not been caught up earlier.

Cheers,

Thomas

Hi everyone,

The errors during the byte-compiling of the packages are harmless and the library still works. We need to package some code for the library that is Python 2 only to keep providing Python 2 support. Therefore, this problem will exist for the foreseeable future when installing the module with setup.py. We’ve added a note to our documentation for this.

The explanation from our doc doesn’t render well at all when linked from here so I’ll copy it instead.


Installing with setup.py

From a local copy of the repository, you can run python setup.py install to copy the package inside your python site-packages . Note that while setuptools will complain about syntax errors when installing the library, the library is fully functional. However, it ships with both Python 2 and Python 3 copies of httplib2 , which will generate syntax errors when byte-compiling the Python modules.


Note that this message says nothing about xmlrpclib. We’re going to look into why this file has not been completely removed during the porting process and remove it if we can. The point about byte-compiling the module for httplib2 will remain however.

1 Like