Windows 10 and Unable to find vcvarsall.bat

谁说我不能喝 提交于 2019-11-28 06:04:41

The issue is caused because you don't have a compiler installed for the receptive build you are trying to run.


The following is what you may require as per the MS Python Engineering community,

Python Version  |You will need
------------------------------------
3.5 and later   |Visual C++ Build Tools 2015 or Visual Studio 2015
3.3 and 3.4     |Windows SDK for Windows 7 and .NET 4.0
                |(Alternatively, Visual Studio 2010 if you have access to it)
2.6 to 3.2      |Microsoft Visual C++ Compiler for Python 2.7

You will need to install: Windows SDK for Windows 7 and .NET 4.0 or VS 2010


Source: How to deal with the pain of “unable to find vcvarsall.bat”

I did a search for a python wheel of LinPy unfortunately there happened to be none.

Cython has a very good workaround for setting up a windows C/C++ compiler for builds in python. You can find it here. Since you've already downloaded the SDK/.NET framework, you should go ahead and install it as it will be needed as part of the steps. If your system reports there is already an existing version, you may uninstall, restart and reinstall.

A hackish alternative is to search for vcvars32.bat or vcvarsall.bat (these batch files are only to set up environment variables for compile time) in your Visual studio installation directory. If you don't find any, then you should install the SDK. I managed to do a work around by hardcoding the path to vcvars32.bat or vcvarsall.bat in the find_vcvarsall function of C:\Python34\Lib\distutils\msvc9compiler.py, but there is a missing library (ISL - Integer Set Library). I think it's because I am using VC11.

I don't have the SDK, but you may try these and see what happens from your end

You can ease your pains with Microsoft compilers for Python 3.4 by installing mingwpy or libpython (not both):

pip install -i https://pypi.anaconda.org/carlkl/simple mingwpy

conda install libpython

Step 1: Install Visual C++ 2010 Express from here.

(Do not install Microsoft Visual Studio 2010 Service Pack 1 )

Step 2: Remove all the Microsoft Visual C++ 2010 Redistributable packages from Control Panel\Programs and Features. If you don't do those then the install is going to fail with an obscure "Fatal error during installation" error.

Step 3: Install offline version of Windows SDK for Visual Studio 2010 (v7.1) from here. This is required for 64bit extensions. Windows has builtin mounting for ISOs like Pismo.

Step 4: You need to install the ISO file with Pismo File Mount Audit Package. Download Pismo from here

Step 5: Right click the downloaded ISO file and choose mount with Pismo. Thereafter, install the Setup\SDKSetup.exe instead of setup.exe.

Step 6a: Create a vcvars64.bat file in C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64 by changing directory to C:\Program Files (x86)\Microsoft Visual Studio version\VC\ on the command prompt. Type command on the command prompt: cd C:\Program Files (x86)\Microsoft Visual Studio version\VC\r

Step 6b: To configure this Command Prompt window for 64-bit command-line builds that target x86 platforms, at the command prompt, enter: vcvarsall x86</p>

carlkl

To use mingwpy instead of the MSVC compiler create a file named pydistutils.cfg in the folder %USERPROFILE% with the following content:

[config]
compiler=mingw32
[build]
compiler=mingw32
[build_ext]
compiler=mingw32

see also How to use MinGW's gcc compiler when installing Python package using Pip?

To add to what Ani Menon answered and addressing Jacobian's(OP) issues he had in response... I had the same issue so I followed this StackOverflow post regarding changing the version number of .NET in the registry temporarily. It's probably a good idea to change the registry value back after.

https://stackoverflow.com/a/33260090/4637870

This succeeded in getting me past the .NET 4 not installed error, but then I was presented with another error towards that the installation was unsuccessful.

I had to remove both the x86 and x64 instances of the Microsoft Visual C++ 2010 Redistributable and let the SDK install it for me. After doing so I was able to make it all the way through the setup without error. This is where I got my information from:

Forum: https://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/381299c9-1bf4-44d4-989c-871735c6b4ca/windows-sdk-for-windows-7-and-net-framework-4-wont-install?forum=windowssdk

Fix: https://support.microsoft.com/de-de/help/2717426/windows-sdk-fails-to-install-with-return-code-5100

I tried running pip on the same package and the error: Unable to find vcvarsall.bat is gone. Now I have a ValueError: ['path'] but thats another issue. Hope this information helps.

For info on my setup im running windows 7 and python 3.4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!