This thread will be updated each time a new version of the Python for Unity package becomes available.
For more information about Python for Unity, please have a look at our documentation.
Please create a new thread for feature requests, bug reports, or general discussion using the python tag. For bug reports in particular, it helps us immensely if you prepare a minimal project that reproduces your issue. Submit a bug report using the Unity Bug Reporter and include the id you receive (via email) in your post.
We are thrilled to announce that Python for Unity 4.0.0-exp.5 is now available!
Python for Unity integrates the Python programming language with Unity, so that you can adapt your studioās existing pipeline scripts:
Automate scene and sequence assembly in the context of using Unity as a real-time renderer.
Automate time consuming tasks like duplicating or modifying a large quantity of Assets.
Author custom editor tools that could both use complex UI elements and interact natively with other DCC suites.
Python for Unity provides:
A Python Script Editor window principally aimed at Technical Artists who want to run short scripts and easily create new menu items that run Python code.
An API aimed at Pipeline Technical Directors who want to call studio scripts implemented in Python from C# and vice versa.
Project Settings.
Installing and loading Pip Packages.
4.0.0-exp.5 is a major upgrade from our last public release, and incorporates a large number of changes. In summary:
Based on Python 3.7; scripts based on Python 2.7 will need to be ported.
Users no longer need to install Python on their system.
In-process Python is no longer reinitialized when the Unity domain reloads.
Removed the out-of-process API. The PySide example now runs in-process and is much simpler.
Limited support for a virtual environment workflow via the ProjectSettings/requirements.txt file.
Many bug fixes.
Documentation for the Python for Unity package is available here, and the full changelog can be found here.
This is an experimental release, and thus is not visible in Package Manager. To install this package, open Package Manager, click the + at the top left and select Add package by nameā¦. Enter com.unity.scripting.python as the name and and 4.0.0-exp.5 as the version and click Add. Alternatively, you may edit Packages/manifest.json and add "com.unity.scripting.python": "4.0.0-exp.5", to the list of dependencies, or edit the existing entry for Python for Unity to update the version.
Python for Unity is built on the open source Python for .NET project. We are indebted to the maintainers: thank you Amos, Benedikt, and Victor!
Edit 2021/09/20: A bug prevents the package from automatically installing the Python binaries package for the current platform. You can manually install the binaries for your platform using Add package by nameā¦ and entering either com.unity.scripting.python.windows or com.unity.scripting.python.macos. This issue will be fixed in an upcoming release.
In Unity 2022.1, open the Project Settings, select Package Manager, and check the āEnable pre-release packageā checkbox. Python for Unity will now be visible in the Package Manager.
In Unity 2019.4+, open the Package Manager, click the + button at the top left and select Add package by nameā¦. In the popup that appears, enter com.unity.scripting.python in the Name field and click Add.