Live data from Hacker News

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

blogs.msdn.microsoft.com

21–25 of 25 posts

Re: MS Python: How to deal with the pain of “unable to find vcvarsall.bat”

#21

If none of these options is available, you will need to consider building the extension yourself. In many cases this is not difficult... This is horseshit. I spent a few weeks at the beginning of the year building MSIs for SaltStack and its dependencies, as I wanted a fully native way to bootstrap a Windows client installation via GPO using a native Python installation instead of SaltStack's NSIS executable installer…

Not trying to be rude, but that seems more like an issue with lack of research, for all of your initial troubles. Python was compiled by Visual Studio 2008, up until Python 3.5, and I believe that was made clear in the extension module documentation for python. Having used 3.5 and VS2015 (after waiting for multiple days just for VS to finish installing), everything else has worked pretty spiffy since

You're not being rude at all.

The extension module documentation, including this blog post, says to use Microsoft Visual C++ Compiler for Python 2.7. I couldn't get it to work properly, and I tried the other toolchains after quite a bit of research, a word which here means "reading through the Python source code and trying various search terms in a vain attempt to solve a problem that apparently isn't a problem for anyone else, but they can't be bothered to specify their obviously functional build environments in sufficient detail for me, an expert in the art, to recreate in a clean virtual machine here at home". It was only after this little endeavour of mine that I came to appreciate people's work on reproducible builds, Vagrant, etc.

And you aren't kidding about that VS2015 install taking forever and a day. Updates are almost as bad.

Re: MS Python: How to deal with the pain of “unable to find vcvarsall.bat”

#22
post #3

I guess I knew in general about wheels but didn't see how it would solve "usability" problems like this one. Does `pip install lxml` fail in a similarly perplexing way if you don't have `build-essential` (`gcc` et al) installed? If so maybe the difference is that the posix/linux crowd is more likely to have installed a compiler at this point. Here's hoping MSFT's Linux ABI support evolves into the norm for a port tar…

I tried to get into linux development within the last year or so. One of the most frustrating obstacles I ran into was that attempting to install packages would mysteriously fail. I found it that was because I was missing a package called "build-essential". I thought one of the package manager's reason for existence was that it could track dependencies, and it didn't appear to be doing that. I still don't understand…

Packaging dependencies and build dependencies are tracked separately. For example, if I don't have a C compiler installed, installing a development package like "libxml2-devel" will probably cause the compiler to be installed.

In the opposite case, say that I have the compiler installed, but not the dev package for the library. Compiling an object will fail, if it #includes a required header, but that will be in the form of a "file not found" error emitted by the compiler. Similarly, if I tried to link a program and include the "-lxml2" flag, the linker will reply "cannot find -lxml2", meaning that libxml2 isn't installed, so it can't be linked against.

Generally, we'd say that it's not the compiler or linker's job to talk to the package manager. The build configuration system included with the project (autoconf scripts, cmake or ant profiles, etc) ought to check for prerequisites.

Re: MS Python: How to deal with the pain of “unable to find vcvarsall.bat”

#23
On the other hand, strawberry perl (http://strawberryperl.com/) for windows solved this by simply including a free toolchain (gcc). The gcc compiler for windows is hardly typical, but it was an interesting choice so that they could have more control over the build environment.

That said, I think MS can/should make installing a toolchain easier than they do. It ought to just be another component of the OS that you can choose to have or not have. Supporting different versions of the compiler on one box is a more advanced use-case that advanced developers can deal with - but each rev of the OS should have the "default" toolchain that installs seamlessly.

Re: MS Python: How to deal with the pain of “unable to find vcvarsall.bat”

#24
post #13

Earlier quoted context omitted.

Last time I tried doing this, it was very unclear to me if there was a way to download the VS compiler without giving an email address or logging in or something to Microsoft. In the end, this was one of the big drivers that pushed me over the edge to switching to 100% Linux.

This is the link where you download the MSVC for Python 2.7 installer: https://www.microsoft.com/en-us/download/details.aspx?id=442... Once it loads, close the survey popup thay may or may not appear and hit the download button. No need to login or put your email or anything. I thought you were going to say that even with it installed, there are rare ocassions where the system doesn't acknowledge the existance of MSV…

Well, I don't need it now because I'm off Windows permanently, and I would use Python 3.x even if I were, but it's good to know that something like this is available. I was sorta wondering if the situation had changed since I looked about 18 months ago.

Re: MS Python: How to deal with the pain of “unable to find vcvarsall.bat”

#25
post #3

I guess I knew in general about wheels but didn't see how it would solve "usability" problems like this one. Does `pip install lxml` fail in a similarly perplexing way if you don't have `build-essential` (`gcc` et al) installed? If so maybe the difference is that the posix/linux crowd is more likely to have installed a compiler at this point. Here's hoping MSFT's Linux ABI support evolves into the norm for a port tar…

I tried to get into linux development within the last year or so. One of the most frustrating obstacles I ran into was that attempting to install packages would mysteriously fail. I found it that was because I was missing a package called "build-essential". I thought one of the package manager's reason for existence was that it could track dependencies, and it didn't appear to be doing that. I still don't understand…

build-essentials is an Ubuntu package which depends on a number of important libraries, gcc, the associated toolchain, etc. Just installing a pre-compiled package won't require a compiler though, it's only when you want to build something from source that you need it. There are a number of python packages that don't come pre-compiled; that may be what you were seeing.
Post reply on HN