Build of WebGL project fails if Python 3 is installed

Using unity 2021.1.6f1

  1. Create a new Unity project.

  2. Add fmod plugin. Window->Package Manager, FMOD for unity. (If its not there you might need to download fmodstudio20109.unitypackage, and just import it)

  3. Build unity project, it shall succeed. (make sure platform is WebGL)

  4. Download python 3 (

  5. Install it for all users, select “Add Python 3.9 to PATH”, then “Custom installation”.

  6. On the next screen select “for all users (requires elevation)”

  7. On the next screen select “Install for all users” → Click install button.

  8. Start search “environment variables”, Add PYTHONPATH and PYTHONHOME set both to “C:\Program Files\Python39”

  9. Restart computer.

  10. Build unity project, it shall fail with 3 errors. (make sure platform is WebGL)

The first error is:
Exception: Unity.IL2CPP.Building.BuilderFailedException: File “C:\Program Files\Python39\lib\”, line 178
SyntaxError: invalid syntax

I’m not sure that’s got anything to do with FMOD. Does the problem occur if you don’t include the FMOD plugin? Does the problem occur if you include a different non-FMOD plugin?

You are correct, it also happens with another non-FMOD plugin (and now it seems without any plugins also). I was so sure I had found the problem that I didn’t think about that…

I have sent a modified bug-reproduce-report to Unity.