posted on 2023-05-21 18:09 read(285) comment(0) like(9) collect(1)
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/
When we install most of the python packages , it can be solved by pip install or conda install, but some packages cannot be installed. For example, mine will report that Microsoft Visual C++ 14.0 is required. Get it with “Microsoft Visual C++ Build Tools" error.
Cause:
The reason for this is that part of the code in the library installed by pip is not python but written in C++ and other codes. We need to compile and install this type of library when we install it.
1. Install Microsoft C++ Build Tools software
Seeing an error in the installation package, it is really laborious to install. Also big.
2. whl pip install solution
We can find .whl
the files corresponding to the library. Here we give a summary download site.whl
for files
【https://www.lfd.uci.edu/~gohlke/pythonlibs/orhttps://pypi.org/project/ 】_ _
We need to judge based on the file name, here we analyze the following file names:
lxml‑4.9.0‑cp311‑cp311‑win_amd64.whl
Among them, cp311 represents the CPython 3.11 version, win represents the windows system, and amd64 represents the 64-bit system. For example, I use Python 3.11 downloaded from the official website and my operating system is 64-bit Windows, so I can download this file and install it.
Type the following command:
pip install lxml‑4.9.0‑cp311‑cp311‑win_amd64.whl
The corresponding library can be installed.
3. Conda specifies the installation solution
conda install libpython m2w64-toolchain -c msys2
simple right?
Main reference: stackoverflow
4. Supplements
It seems that I can't think of other things for the time being. I have been tortured by this problem all night. Using linux will not cause such problems. Using windows is just to adapt, haha, waste of time.
5. Remarks
When solving the problem of Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools, I have already used the downloaded .whl package for pip installation, and there is no problem at present. I need to use conda later install libpython m2w64-toolchain -c msys2
Author:gfg
link:http://www.pythonblackhole.com/blog/article/25338/bf762b59f40aa6fa05c4/
source:python black hole net
Please indicate the source for any form of reprinting. If any infringement is discovered, it will be held legally responsible.
name:
Comment content: (supports up to 255 characters)
Copyright © 2018-2021 python black hole network All Rights Reserved All rights reserved, and all rights reserved.京ICP备18063182号-7
For complaints and reports, and advertising cooperation, please contact vgs_info@163.com or QQ3083709327
Disclaimer: All articles on the website are uploaded by users and are only for readers' learning and communication use, and commercial use is prohibited. If the article involves pornography, reactionary, infringement and other illegal information, please report it to us and we will delete it immediately after verification!