Python and Visual C++ Build Tools (pip install cannot install the package normally)

  • In the windows environment, python needs to call the Microsoft Visual C++ compiler, especially when installing a third-party package, it will build the project. At this time, if the c++ build tool is not installed or installed, an error will be reported. Before this happened, many experience posts would suggest that we install VS. VS is a behemoth (Visual Studio 15 is now solving the problem of being too bulky). Now it's good, you can install Visual C++ Build Tools directly to solve the problem. This is a VC++ compiler. After installation, you can successfully install the Python package containing the C/C++ source code. When developing applications or libraries under windows, if you don't want to install the complete visual studio, you can choose to install only the build tools and perform operations such as compilation under the command line. This can save hard disk space, the actual measurement occupies 7GB, and it is installed on the C drive, Microsoft Visual c++ build tools only install the command line compiler, tools and libraries needed to build C and c++ programs.
  • Insert picture description here
    Different python versions need to install different versions of the c++ compiler, and the architecture of the compiler must be the same as that of Python (for example, if you use Python 64-bit, you must use an x64 compiler). In the py3.5+ version, the windows environment needs to install the c++ build tool above c++14.0, and the c++14.0 build tool is included in VS2015 and above. The following website also gives a brief introduction.

https://wiki.python.org/moin/WindowsCompilers#Microsoft_Visual_C.2B-.2B-_14.0_standalone:_Visual_C.2B-.2B-Build_Tools_2015.28x86.2C_x64.2C_ARM.29

Guess you like

Origin blog.csdn.net/qq_42308217/article/details/110083420