Small guide to fusion studio python troubleshoting

I was having a bit of trouble running the addon on Fusion studio 16, @BigRoy helped me on discord and I wanted to post here what we went through to help anyone that is having the same problem.
I was getting an error that said that I didn’t have PySide installed

For this particular issue the solution was upgrading to the latest version of python 3.6 and installing PySide on that version, for completion sake, to install pyside just go to the folder where Python 3.6 is installed and in the command line run:

python -m pip install PySide2

Now, one thing that is important to comment is that before fusion 18 you are limited to python 2.7 and 3.6 in their default locations, starting on 18 you can use 3.6 - 3.10 and use the FUSION_PYTHON3_HOME variable.

So if you want to set up python for fusion on AYON using 18+, just go to the application settings for fusion and set up the environment to something like:

{
    "FUSION_PYTHON3_HOME": "{FUSION18_PYTHON36_HOME}",
    "FUSION18_PYTHON36_HOME": {
        "windows": "{LOCALAPPDATA}/Programs/Python/Python39",
        "darwin": "~/Library/Python/3.6/bin",
        "linux": "/opt/Python/3.6/bin"
    }
}

Here I’m using Fusion 16, so the variable is irrelevant, but the idea is the same.

Hopefully this can help someone that is having some issues with Python in fusion.

Thanks for sharing your experience!
I applied some cosmetics to your guide, I hope you don’t mind.


A Quick Recap.
Please, correct me if I wrong.

Problem:
PySide2 library was missing in fusion’s python home directory.

Solution:
For Fusion 18+ versions which use Python 3

  1. Install Python 3 on your device (if you don’t have it already)

  2. install PySide2 as follows:
    Run this commend in your terminal

    python -m pip install PySide2
    
  3. Find your Python 3 installation path on windows, linux and mac.
    e.g.:

    "windows": "{LOCALAPPDATA}/Programs/Python/Python39"
    "darwin": "~/Library/Python/3.6/bin"
    "linux": "/opt/Python/3.6/bin"
    
  4. Update Fusion Environment in Ayon Application Settings as follows:

    {
        "FUSION_PYTHON3_HOME": "{FUSION18_PYTHON36_HOME}",
        "FUSION18_PYTHON36_HOME": {
            "windows": "{LOCALAPPDATA}/Programs/Python/Python39",
            "darwin": "~/Library/Python/3.6/bin",
            "linux": "/opt/Python/3.6/bin"
        }
    }