I'm working on Ubuntu 20. I'm trying to compile for WebGL

I get an error when building for Web.
I don’t know how to fix it. help me!

Building Library/Bee/artifacts/WebGL/il2cpp/release_WebGL_wasm/gheploasb872.o failed with output:
Traceback (most recent call last):
  File "/mnt/work/gamedev/engine/unity3d/2022.3.6f1/Editor/Data/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/emscripten/emcc.py", line 23, in <module>
    from tools.toolchain_profiler import ToolchainProfiler
  File "/mnt/work/gamedev/engine/unity3d/2022.3.6f1/Editor/Data/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/emscripten/tools/toolchain_profiler.py", line 17, in <module>
    from . import response_file
  File "/mnt/work/gamedev/engine/unity3d/2022.3.6f1/Editor/Data/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/emscripten/tools/response_file.py", line 10, in <module>
    from .utils import WINDOWS
  File "/mnt/work/gamedev/engine/unity3d/2022.3.6f1/Editor/Data/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/emscripten/tools/utils.py", line 11, in <module>
    from . import diagnostics
  File "/mnt/work/gamedev/engine/unity3d/2022.3.6f1/Editor/Data/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/emscripten/tools/diagnostics.py", line 9, in <module>
    import ctypes
  File "/usr/local/lib/python3.8/ctypes/__init__.py", line 7, in <module>
    from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'

UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&) (at /home/bokken/build/output/unity/unity/Modules/IMGUI/GUIUtility.cs:190)

That’s a Python error. Try

sudo apt install libffi-dev
Reading package lists... Done
Building dependency tree 
Reading state information... Done
libffi-dev is already the newest version (3.3-4).
0 to upgrade, 0 to newly install, 0 to remove and 1 not to upgrade.

It was installed but it didn’t help

What happen if you starts python manually and import _ctypes?
Which version of Python is the default on your machine?

This is my problem, maybe I once damaged the system Python. I do not know what to do.

What makes you believe your broke python? Did you install it from source or tweaked the installation?
If in doubt you can always use apt reinstall to repair it.

I fixed it, the system Python was broken, in my opinion it was still a long time ago.

Was:
/usr/local/bin/python3.8 -c “import ctypes”
Traceback (most recent call last):
File “”, line 1, in
File “/usr/local/lib/python3.8/ctypes/init.py”, line 7, in
from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named ‘_ctypes’

I did:
sudo rm /usr/local/bin/python3.8
sudo ln -s /home/technoninja/.pyenv/shims/python3.8 /usr/local/bin/python3.8

Be sure to pay attention to pyenv