Pip install error WIndows 10 Python 3.9

I have wxPython successfully installed under Python 3.8.3. I tried upgrading to Python 3.9.13. When I tried to install wxpython I got this error:

c:\Python39>python -m pip install wxpython
Collecting wxpython
Using cached wxPython-4.2.0.tar.gz (71.0 MB)
Preparing metadata (setup.py) … error
error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [8 lines of output]
Traceback (most recent call last):
File “”, line 2, in
File “”, line 34, in
File “C:\Users\robcl\AppData\Local\Temp\pip-install-tl3ktn1s\wxpython_eae0721dec2b4089893c16b4d1180a2d\setup.py”, line 27, in
from buildtools.config import Config, msg, opj, runcmd, canGetSOName, getSOName
File “C:\Users\robcl\AppData\Local\Temp\pip-install-tl3ktn1s\wxpython_eae0721dec2b4089893c16b4d1180a2d\buildtools\config.py”, line 30, in
from attrdict import AttrDict
ModuleNotFoundError: No module named ‘attrdict’
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

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

I installed attrdict with pip, tried again, and got another error. The first part of the output I redirected to a file; of the rest (presumably sent to stderr not stdout), some disappeared off the top of the screen. Here is what I have:

Collecting wxpython
Using cached wxPython-4.2.0.tar.gz (71.0 MB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status ‘done’
Collecting pillow
Using cached Pillow-9.4.0-cp39-cp39-win32.whl (2.2 MB)
Requirement already satisfied: six in c:\python39\lib\site-packages (from wxpython) (1.16.0)
Collecting numpy
Using cached numpy-1.24.2-cp39-cp39-win32.whl (12.5 MB)
Installing collected packages: pillow, numpy, wxpython
Running setup.py install for wxpython: started
Running setup.py install for wxpython: finished with status ‘error’

c:\Python39\lib\site-packages\setuptools\dist.py:294: DistDeprecationWarning: use_2to3 is ignored.
warnings.warn(f"{attr} is ignored.", DistDeprecationWarning)
running install
running build
Will build using: “c:\Python39\python.exe”
3.9.13 (tags/v3.9.13:6de2ca5, May 17 2022, 16:24:45) [MSC v.1929 32 bit (Intel)]
Python’s architecture is 32bit
cfg.VERSION: 4.2.0

  Running command: build
  Running command: build_wx
  Command '"c:\Python39\python.exe" -c "import os, sys, setuptools.msvc; setuptools.msvc.isfile = lambda path: path is not None and os.path.isfile(path); ei = setuptools.msvc.EnvironmentInfo('x86', vc_min_ver=14.0); env = ei.return_env(); env['vc_ver'] = ei.vc_ver; env['vs_ver'] = ei.vs_ver; env['arch'] = ei.pi.arch; env['py_ver'] = sys.version_info[:2]; print(env)"' failed with exit code 1.
  Traceback (most recent call last):

    File "<string>", line 1, in <module>

    File "c:\Python39\lib\site-packages\setuptools\msvc.py", line 1222, in __init__

      self.si = SystemInfo(self.ri, vc_ver)

    File "c:\Python39\lib\site-packages\setuptools\msvc.py", line 698, in __init__

      vc_ver or self._find_latest_available_vs_ver())

    File "c:\Python39\lib\site-packages\setuptools\msvc.py", line 712, in _find_latest_available_vs_ver

      raise distutils.errors.DistutilsPlatformError(

  distutils.errors.DistutilsPlatformError: No Microsoft Visual C++ version found
  Finished command: build_wx (0.313s)
  Finished command: build (0.314s)
  WARNING: Building this way assumes that all generated files have been
  generated already.  If that is not the case then use build.py directly
  to generate the source and perform the build stage.  You can use
  --skip-build with the bdist_* or install commands to avoid this
  message and the wxWidgets and Phoenix build steps in the future.

  "c:\Python39\python.exe" -u build.py build
  Command '"c:\Python39\python.exe" -u build.py build' failed with exit code 1.
  [end of output]

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 installed attrdict3 with pip and tried again:

Collecting wxpython
Using cached wxPython-4.2.0.tar.gz (71.0 MB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status ‘done’
Requirement already satisfied: pillow in c:\python39\lib\site-packages (from wxpython) (9.4.0)
Requirement already satisfied: six in c:\python39\lib\site-packages (from wxpython) (1.16.0)
Requirement already satisfied: numpy in c:\python39\lib\site-packages (from wxpython) (1.24.2)
Installing collected packages: wxpython
Running setup.py install for wxpython: started
Running setup.py install for wxpython: finished with status ‘error’

c:\Python39\lib\site-packages\setuptools\dist.py:294: DistDeprecationWarning: use_2to3 is ignored.
warnings.warn(f"{attr} is ignored.", DistDeprecationWarning)
running install
running build
Will build using: “c:\Python39\python.exe”
3.9.13 (tags/v3.9.13:6de2ca5, May 17 2022, 16:24:45) [MSC v.1929 32 bit (Intel)]
Python’s architecture is 32bit
cfg.VERSION: 4.2.0

  Running command: build
  Running command: build_wx
  Command '"c:\Python39\python.exe" -c "import os, sys, setuptools.msvc; setuptools.msvc.isfile = lambda path: path is not None and os.path.isfile(path); ei = setuptools.msvc.EnvironmentInfo('x86', vc_min_ver=14.0); env = ei.return_env(); env['vc_ver'] = ei.vc_ver; env['vs_ver'] = ei.vs_ver; env['arch'] = ei.pi.arch; env['py_ver'] = sys.version_info[:2]; print(env)"' failed with exit code 1.
  Traceback (most recent call last):

    File "<string>", line 1, in <module>

    File "c:\Python39\lib\site-packages\setuptools\msvc.py", line 1222, in __init__

      self.si = SystemInfo(self.ri, vc_ver)

    File "c:\Python39\lib\site-packages\setuptools\msvc.py", line 698, in __init__

      vc_ver or self._find_latest_available_vs_ver())

    File "c:\Python39\lib\site-packages\setuptools\msvc.py", line 712, in _find_latest_available_vs_ver

      raise distutils.errors.DistutilsPlatformError(

  distutils.errors.DistutilsPlatformError: No Microsoft Visual C++ version found
  Finished command: build_wx (0.253s)
  Finished command: build (0.253s)
  WARNING: Building this way assumes that all generated files have been
  generated already.  If that is not the case then use build.py directly
  to generate the source and perform the build stage.  You can use
  --skip-build with the bdist_* or install commands to avoid this
  message and the wxWidgets and Phoenix build steps in the future.

  "c:\Python39\python.exe" -u build.py build
  Command '"c:\Python39\python.exe" -u build.py build' failed with exit code 1.
  [end of output]

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 had a similar problem trying to install wxpython with Python 3.10.10.
Please help!
Thanks
Rob