Today I am writing a small program , This problem was found when installing dependencies , It is usually installed directly Visual Studio solve , But this installation is too big , So it is most convenient to see how to install it , The easiest to solve .
Here is the problem :
building 'bitarray._bitarray' extension
error: Microsoft Visual C++ 14.0 or greater is required.
Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
[end of output],
To solve this problem , Start Baidu first , There are two main ways to find out .
Download the corresponding version directly .whl file , And then run pip install xxx.whl Installation . This method is to bypass the compilation step , So don't rely on c++ Environment , But I don't really recommend this solution , Because I have to find it every time wel file , This is still a little troublesome , So in order to be lazy , After all, laziness is the primary productive force , It is still suggested to find out the environmental dependence , Install well , Subsequent packages are required directly pip Just install it .
According to the output information , We can download and install "Microsoft C++ Build Tools" This tool , To install this environment , Install one directly visual Studio A dozen G It can be , He will automatically install all the necessary packages for you , It's just too big , Many unnecessary packages are also installed .
Last export configuration , See what libraries and components are installed . It looks like some core components , also windows Developed SDK, And some compiling tools .
Install like this , We don't have to install the whole 10+G Of visual Studio.
Article reference :python in ,Microsoft Visual C++ 14.0 or greater is required Problem solution