Your path only lists Visual Studio 11 and 12, it wants 14, which is Visual Studio 2015. If you install that, and remember to tick the box for Languages->C++ then it should work.
On my Python 3.5 install, the error message was a little more useful, and included the URL to get it from
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
I can’t believe no one has suggested this already – use the binary-only option for pip. For example, for mysqlclient:
pip install --only-binary :all: mysqlclient
Many packages don’t create a build for every single release which forces your pip to build from source. If you’re happy to use the latest pre-compiled binary version, use --only-binary :all: to allow pip to use an older binary version.
请注意,如果您已经安装了Visual Studio,则在运行安装程序时可以修改您的安装程序(在Visual Studio Community 2017下单击“修改”按钮)并执行步骤3和4
最后的注意事项:如果您不想安装所有模块,那么拥有下面的3个模块(或VC ++ 2017的较新版本)就足够了。(您也可以仅使用这些选项来安装Visual Studio Build Tools,因此您不需要安装Visual Studio Community Edition本身)=>此最小安装已经是4.5GB,因此保存所有内容都会有所帮助
Select free download under Visual Studio Community 2017. This will download the installer. Run the installer.
Select what you need under workload tab:
a. Under Windows, there are 3 choices. Only check Desktop development with C++
b. Under Web & Cloud, there are 7 choices. Only check Python development (I believe this is optional But I have done it).
In cmd, type pip3 install misaka
Note if you already installed Visual Studio then when you run the installer, you can modify yours (click modify button under Visual Studio Community 2017) and do steps 3 and 4
Final Note : If you don’t want to install all modules, having the 3 ones below (or a newer version of the VC++ 2017) would be sufficient. (you can also install the Visual Studio Build Tools with only these options so you dont need to install Visual Studio Community Edition itself) => This minimal install is already a 4.5GB, so saving off anything is helpful
As the other responses pointed out, one solution is to install Visual Studio 2015. However, it takes a few GBs of disk space. One way around is to install precompiled binaries. The webpage http://www.lfd.uci.edu/~gohlke/pythonlibs (mirror) contains precompiled binaries for many Python packages. After downloading the package of interest to you, you can install it using pip install, e.g. pip install mysqlclient‑1.3.10‑cp35‑cp35m‑win_amd64.whl.
I’d recommend saving that wheel file in the directory where you’ve installed Python i.e somewhere in Local Disk C
Then visit the folder where the wheel file exists and run pip install <*wheel file's name*>
Finally run the command pip install Scrapy again and you’re good to use Scrapy or any other tool which required you to download massive Windows C++ Package/SDK.
Disclaimer: This solution worked for me while trying to install Scrapy, but I can’t guarantee the same happening while installing other softwares/packages/etc.✌
回答 5
我在尝试安装时遇到了这个确切的问题mayavi。
因此,error: Microsoft Visual C++ 14.0 is required在安装库时,我也有共同点。
转到Visual Studio 2017的构建工具并安装Build Tools for Visual Studio 2017。下All downloads(向下滚动)>>Tools for Visual Studio 2017
如果已经安装,请跳至2。
选择C++ Components您需要的(我不知道我需要哪个,所以安装了许多)。
如果已经安装,Build Tools for Visual Studio 2017则打开应用程序,Visual Studio Installer然后转到Visual Studio Build Tools 2017>> Modify>>,Individual Components然后选择所需的组件。
从其他的答案中的重要组成部分似乎是:C++/CLI support,VC++ 2017 version <...> latest,Visual C++ 2017 Redistributable Update,Visual C++ tools for CMake,Windows 10 SDK <...> for Desktop C++,Visual C++ Build Tools core features,Visual Studio C++ core features。
为安装/修改这些组件Visual Studio Build Tools 2017。
这是重要的一步。打开应用程序,Visual Studio Installer然后转到Visual Studio Build Tools>> Launch。这将在正确的位置打开CMD窗口Microsoft Visual Studio\YYYY\BuildTools。
I had this exact issue while trying to install mayavi.
So I also had the common error: Microsoft Visual C++ 14.0 is required when pip installing a library.
After looking across many web pages and the solutions to this thread, with none of them working. I figured these steps (most taken from previous solutions) allowed this to work.
Go to Build Tools for Visual Studio 2017 and install Build Tools for Visual Studio 2017. Which is under All downloads (scroll down) >> Tools for Visual Studio 2017
If you have already installed this skip to 2.
Select the C++ Components you require (I didn’t know which I required so installed many of them).
If you have already installed Build Tools for Visual Studio 2017 then open the application Visual Studio Installer then go to Visual Studio Build Tools 2017 >> Modify >> Individual Components and selected the required components.
From other answers important components appear to be: C++/CLI support, VC++ 2017 version <...> latest, Visual C++ 2017 Redistributable Update, Visual C++ tools for CMake, Windows 10 SDK <...> for Desktop C++, Visual C++ Build Tools core features, Visual Studio C++ core features.
Install/Modify these components for Visual Studio Build Tools 2017.
This is the important step. Open the application Visual Studio Installer then go to Visual Studio Build Tools >> Launch. Which will open a CMD window at the correct location for Microsoft Visual Studio\YYYY\BuildTools.
Now enter python -m pip install --upgrade setuptools within this CMD window.
Finally, in this same CMD window pip install your python library: pip install -U <library>.
回答 6
安装spaCy模块时遇到相同的问题。我检查了控制面板,我已经安装了几个可视的C ++可再发行组件。
我所做的是选择已经安装在我的PC上的“ Microsoft Visual Studio Community 2015”->“修改”->选中“ Visual C ++ 2015通用工具”。然后,将花费一些时间并下载超过1 GB的空间进行安装。
I had the same problem when installing spaCy module. And I checked control panel I have several visual C++ redistributables installed already.
What I did was select “Microsoft Visual Studio Community 2015” which is already installed on my PC –> “Modify” –>check “Common Tools for Visual C++ 2015”. Then it will take some time and download more than 1 GB to install it.
After reading a lot of answers in SO and none of them working, I finally managed to solve it following the steps in this thread, I will leave here the steps in case the page dissapears:
Please try to install Build Tools for Visual Studio 2017, select the workload “Visual C++ build tools” and check the options “C++/CLI support” and “VC++ 2015.3 v14.00 (v140) toolset for desktop” as below.
You should now no longer use Visual Studio Tools 2015 since a newer version is available. As indicated by the Python documentation you should be using Visual Studio Tools 2017 instead.
Visual C++ Build Tools 2015 was upgraded by Microsoft to Build Tools for Visual Studio 2017.
Use this link to download and install Visual C++ 2015 Build Tools. It will automatically download visualcppbuildtools_full.exe and install Visual C++ 14.0 without actually installing Visual Studio. After the installation completes, retry pip install and you won’t get the error again.
I have tested it on following platform and versions:
Python 3.6 on Windows 7 64-bit
Python 3.8 on Windows 10 64-bit
I have same suggestion as a comment to the question, however, I have been requested to post this as an answer as it helped a lot of people. So I posted it as an answer.
I am on python3.7 & windows 10 and installing Microsoft Build Tools for Visual Studio 2017 (as described here) did not solve my problem that was identical to yours.
I had the same problem. I needed a 64-bit version of Python so I installed 3.5.0 (the most recent as of writing this). After switching to 3.4.3 all of my module installations worked.
None of the solutions here and elsewhere worked for me. Turns out an incompatible 32bit version of mysqlclient is being installed on my 64bit Windows 10 OS because I’m using a 32bit version of Python
I had to uninstall my current Python 3.7 32bit, and reinstalled Python 3.7 64bit and everything is working fine now
Just go to https://www.lfd.uci.edu/~gohlke/pythonlibs/ find your suitable package (whl file). Download it. Go to the download folder in cmd or typing ‘cmd’ on the address bar of the folder. Run the command :
pip install mysqlclient-1.4.6-cp38-cp38-win32.whl
(Type the file name correctly. I have given an example only). Your problem will be solved without installing build toll cpp of 6GB size.
回答 21
在@Sushant Chaudhary的答案之上添加
就我而言,我又遇到了有关lxml的另一个错误,如下所示
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\readme.txt -> build\lib.win-amd64-3.7\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
running build_ext
building 'lxml.etree' extension
error:MicrosoftVisual C++14.0is required.Get it with"Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
in my case, I got another error regarding lxml as below
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\readme.txt -> build\lib.win-amd64-3.7\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
running build_ext
building 'lxml.etree' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
I had to install lxml‑4.2.3‑cp37‑cp37m‑win_amd64.whl same way as in the answer of @Sushant Chaudhary to successfully complete installation of Scrapy.
cd "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build"
vcvarsall.bat x86_amd64
cd \
set CL=-FI"%VCINSTALLDIR%\tools\msvc\14.16.27023\include\stdint.h"
pip install pycrypto
for Python 3.7.4 following set of commands worked:
Before those command, you need to confirm Desktop with C++ and Python is installed in Visual Studio.
cd "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build"
vcvarsall.bat x86_amd64
cd \
set CL=-FI"%VCINSTALLDIR%\tools\msvc\14.16.27023\include\stdint.h"
pip install pycrypto
I had the same issue while installing mysqlclient for the Django project.
In my case, it’s the system architecture mismatch causing the issue. I have Windows 7 64bit version on my system. But, I had installed Python 3.7.2 32 bit version by mistake.
So, I re-installed Python interpreter (64bit) and ran the command
pip install mysqlclient
I hope this would work with other Python packages as well.
回答 25
我在Windows 10 python版本3.8上遇到了完全相同的问题。就我而言,我需要在发生错误时安装mysqlclientMicrosoft Visual C++ 14.0 is required。因为安装Visual Studio及其软件包可能是一个乏味的过程,所以我做了以下工作:
I had the same exact issue on my windows 10 python version 3.8.
In my case, I needed to install mysqlclient were the error occurred Microsoft Visual C++ 14.0 is required. Because installing visual studio and it’s packages could be a tedious process, Here’s what I did:
step 1 – Go to unofficial python binaries from any browser and open its website.
step 2 – press ctrl+F and type whatever you want. In my case it was mysqlclient.
step 3 – Go into it and choose according to your python version and windows system. In my case it was mysqlclient‑1.4.6‑cp38‑cp38‑win32.whl and download it.
step 4 – open command prompt and specify the path where you downloaded your file. In my case it was C:\Users\user\Downloads
step 5 – type pip install .\mysqlclient‑1.4.6‑cp38‑cp38‑win32.whl and press enter.
Thus it was installed successfully, after which I went my project terminal re-entered the required command. This solved my problem
Note that, while working on the project in pycharm, I also tried installing mysql-client from the project interpreter. But mysql-client and mysqlclient are different things. I have no idea why and it did not work.
I was facing the same problem. The following worked for me:
Download the unoffical binaries file from Christoph Gohlke installers site as per the python version installed on your system.
Navigate to the folder where you have installed the file and run
pip install filename
For me python_ldap‑3.0.0‑cp35‑cp35m‑win_amd64.whl worked as my machine is 64 bit and python version is 3.5.
This successfully installed python-ldap on my windows machine. You can try the same for mysql-python
If Visual Studio is NOT your thing, and instead you are using VS Code, then this link will guide you thru the installer to get C++ running on your Windows.