Having trouble installing wxPython on Windows 11

I am trying to install wxPython on a Windows 11 system, and I am running into some problems. I have Visual Studio 2015 installed along with Python 3.9 (32-bit version). The following is what I believe to be the relevant output of pip3 install -U wxPython:

          link /DLL /NOLOGO /OUT:..\..\lib\vc140_dll\wxmsw32u_gl_vc140.dll  /DEBUG /pdb:"..\..\lib\vc140_dll\wxmsw32u_gl_vc140.pdb" /opt:ref /opt:icf   /LIBPATH:..\..\lib\vc140_dll   @C:\Users\admin\AppData\Local\Temp\nm83A2.tmp
         Creating library ..\..\lib\vc140_dll\wxmsw32u_gl.lib and object ..\..\lib\vc140_dll\wxmsw32u_gl.exp
      Building message catalogs in C:\Users\admin\AppData\Local\Temp\pip-install-dsr623ua\wxpython_68c4ff9f91314769b0c1c6e0d03ee270\ext\wxWidgets\locale
      make allmo
      The system cannot find the path specified.
      t was unexpected at this time.

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> wxPython

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

I would appreciate any help in diagnosing this issue, and I can give more information about my setup if required.

Edit: It might be important to note, I have successfully installed wxPython version 4.1.0 on this machine, which is working in Python 2. However I would like to also be able to use the latest version on Python 3.

Do you really need to use 32-bit Python? Using the pre-built 64-bit binaries would save you a lot of trouble.

I am working on an old legacy software which has .dll files built for 32-bit Windows, and I do not believe we have 64-bit versions of these .dll’s. I do not have access to the C code which generated these files, nor am I in touch with anyone who would know about how they were written.

Earlier I had trouble using our software on Windows (it ran fine on Mac and Linux) due to the mismatched .dll versions, and I solved the issue by switching to 32-bit Python. I fear if I switch back to 64-bit it will require a lot of work, but if it’s the only option then I guess I will have to do it.