You are using Microsoft Visual Studio [inconsistent year/version number/random text string] Gold Ultimate Gentleman's Club With Oak Clusters And Diamonds Edition
TEAM ENTERPRISE Edition Edition of the very latest vintage.
Everything is great, save for the user interface, which has adopted the inexplicable metro design language and looks like a piece of trash as a result (the next version will be nothing but a two-toned ribbon bar, if the trend holds). Also, no Python modules with C components will build:
C:\Users\zplab\Desktop\pyzmq_git>python setup.py build
running build
running build_py
running build_ext
running configure
************************************************
Using bundled libzmq
already have bundled\zeromq
already have platform.hpp
************************************************
building 'zmq.libzmq' extension
error: Unable to find vcvarsall.bat
Uh-huh? So, I'm looking at that file. I can see this vcvarsall.bat file. I'm seeing it, right now. Why is this god-forsaken piece of trash setup.py garbage pile detritus fucking
MOUNTAIN OF SHIT not seeing it?
Because it's looking in a dumb-ass, wrong-ass place. An excerpt starting at 169 of python/Lib/distutils/msvc9compiler.py:
def get_build_version():
"""Return the version of MSVC that was used to build Python.
For Python 2.3 and up, the version number is included in
sys.version. For earlier versions, assume the compiler is MSVC 6.
"""
prefix = "MSC v."
i = sys.version.find(prefix)
if i == -1:
return 6
i = i + len(prefix)
s, rest = sys.version[i:].split(" ", 1)
majorVersion = int(s[:-2]) - 6
minorVersion = int(s[2:3]) / 10.0
# I don't think paths are affected by minor version in version 6
if majorVersion == 6:
minorVersion = 0
if majorVersion >= 6:
return majorVersion + minorVersion
# else we don't know what version of the compiler this is
return None
This is starting to make sense. On Windows, distutils wants to build Python extensions with the same compiler that was used to build Python. I used to have lots of old versions of Visual Blah-dee-blah installed, and building Python extensions always worked when I did.
There are surely some good arguments for building Python extensions with the exact same build # compiler and Microsoft Crappy Runtimes that were used to build the interpreter itself.
Take those arguments, and drop them in the ocean. It works just fine once you work past this fastidious insistence upon a specific Visual Shitbucket edition.
def get_build_version():
"""Return the version of MSVC that was used to build Python.
For Python 2.3 and up, the version number is included in
sys.version. For earlier versions, assume the compiler is MSVC 6.
"""
# prefix = "MSC v."
# i = sys.version.find(prefix)
# if i == -1:
# return 6
# i = i + len(prefix)
# s, rest = sys.version[i:].split(" ", 1)
# majorVersion = int(s[:-2]) - 6
# minorVersion = int(s[2:3]) / 10.0
# # I don't think paths are affected by minor version in version 6
# if majorVersion == 6:
# minorVersion = 0
# if majorVersion >= 6:
# return majorVersion + minorVersion
# # else we don't know what version of the compiler this is
# return None
# All the above is bullshit. This system has Visual Studio 2013 aka 12.0 and that's all there is to it.
return 12
Now we can build:
C:\Users\zplab\Desktop\pyzmq_git>python setup.py build
running build
running build_py
running build_ext
running configure
************************************************
Using bundled libzmq
already have bundled\zeromq
already have platform.hpp
************************************************
building 'zmq.libzmq' extension
creating build\temp.win-amd64-3.4
creating build\temp.win-amd64-3.4\Release
creating build\temp.win-amd64-3.4\Release\buildutils
creating build\temp.win-amd64-3.4\Release\bundled
creating build\temp.win-amd64-3.4\Release\bundled\zeromq
creating build\temp.win-amd64-3.4\Release\bundled\zeromq\src
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DFD_SETSIZE=1024 -DDLL_EXPORT=1 -Ibundled\zeromq\include -IC:\Python34\incl
ude -IC:\Python34\include /Tcbuildutils\initlibzmq.c /Fobuild\temp.win-amd64-3.4\Release\buildutils\initlibzmq.obj /EHsc
initlibzmq.c
Post a Comment