Attempted to compile AOT function without the compiler used by `numpy.distutils` present. Cannot find suitable msvc. 解决办法
When running the python project, I encountered a problem Attempted to compile AOT function without the compiler used by numpy.distutils
present. Cannot find suitable msvc. Then I found some solutions on the Internet, and record it here
cause
I asked a classmate who often uses python. He said that there is a lack of a C++ library. I don’t know the specifics. It should be that some libraries of python require C++ compilation. If you know it, you can point it out in the comment section.
Solution
It is to construct those libraries by installing a Visual Studio 2019 build tool.
1. Download the Visual Studio 2019 build tool
Go to the website https://visualstudio.microsoft.com/zh-hans/downloads/ to download the Visual Studio 2019 generation tool
Click to enter the URL and drop down, find all
the Visual Studio 2019 generation tools under the download, click on it, find the Visual Studio 2019 generation tools as shown in the figure, and click to download
The download is complete, run it, find a C++ generation tool, and install it
2. After the download is complete, restart the computer according to the prompts
After restarting the computer, you can run python below