Skip to content
Advertisement

Installing wxPython on Windows: DistutilsPlatformError: Microsoft Visual C++ 14.2 or greater is required

I have installed:

  • Python 3.10.1
  • PyCharm Community 2021.3
  • Visual Studio Build Tools 2022, including:
    • C++ Build Tools Core Features
    • C++ 2022 Redistributable Update
    • C++ core desktop features
    • MSVC v143 – VS 2022 C++ x64/x86 build tools (Latest)
    • Windows 10 SDK (10.0.19041.0)
    • C++ CMake tools for Windows
    • Testing tools core features – Build Tools
    • C++ AddressSanitizer
    • C++/CLI support for v143 build tools (Latest)
    • C++ Modules for v143 build tools (x64/x86 – experimental)

When trying to install wxPython in my project’s virtualenv, I get this error:

distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.2 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/

Both the error and anything I can find on the internet (including here) tells me to download C++ build tools and install C++ 14.2 or greater / the latest version. I have:

  • done that (see the list above),
  • rebooted
  • venv/Scripts/pip install --upgrade setuptools
  • venv/Scripts/pip install --upgrade wheel
  • venv/Scripts/pip install --upgrade pip

What am I missing here? Is there some sort of path variable that I need to configure somewhere so pip/wheel/setuptools knows where to find the compiler?

Advertisement

Answer

I have the same problem. Solved for me to use Python 3.9.9. Its maybe about a distutils problem in Python 3.10.1 with this warning from msvc9compiler.py:

DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12

This leads to:

raise DistutilsPlatformError(“Unable to find vcvarsall.bat”)

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement