[Maya2013] vcvarsall.bat (Building Python26 modules with VS2010)

Hi guys,

I’m trying to build pyzmq for Maya 2013.
I’ve read that Maya 2013 uses Python26 built with Visual Studio 2010 and how much of an annoying complication it is.

My question is how do you guys build stuff in Python26 with VS2010?

So far I’ve been able to successfully build the solution in ZMQ and come out with the dll libraries I need.
I’ve set up a ‘setup.cfg’ in pyzmq

[build_ext]
library_dirs = ..\zeromq-2.2.0\lib
include_dirs = ..\zeromq-2.2.0\include

Those paths are working fine.
The problem occurs when trying to install the package:

E:\Python26\Lib\site-packages\pyzmq-2.2.0>python setup.py install
running install
running build
running build_py
running build_ext
******************************************
Configure: Autodetecting ZMQ settings...
    Custom ZMQ dir:       ../zeromq-2.2.0
error: Unable to find vcvarsall.bat
Fatal:
    Failed to build or run ZMQ test program.  Please check to make sure:

    * You have a C compiler installed
    * A development version of Python is installed (including header files)
    * A development version of ZMQ >= 2.1.4 is installed (including header files
)
    * If ZMQ is not in a default location, supply the argument --zmq=<path>
    * If you did recently install ZMQ to a default location,
      try rebuilding the ld cache with `sudo ldconfig`
      or specify zmq's location with `--zmq=/usr/local`

******************************************

I’ve set %VS100COMNTOOLS% to the path where vcvarsall.bat is
I’ve set %VS90COMNTOOLS% to VS100COMNTOOLS
I’ve even tried putting the vcvarsall path into %path%
I’ve tried going into E:\Python26\Lib\distutils\msvc9compiler.py and editing the toolskey line 223 to:

        toolskey = "VS100COMNTOOLS"

None of these things have worked. It still can’t find vcvarsall.bat

How do you guys compile things for this version of Maya?
I’ve searched the forums and have seen some of you manage to get some other modules working.

Thanks,
Jesse

Here’s how I did it for PyZMQ and VS11

Just replace the 3dsMax Python install with your Python path install.


@echo off
SETLOCAL
rem Must have ADSK_3DSMAX_2015 and Visual Studio 2012 installed
rem Make compile with VS2011
SET VS10COMNTOOLS=%VS110COMNTOOLS%
SET VS90COMNTOOLS=%VS110COMNTOOLS%
call "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" x86_amd64

SET PYTHON="%ADSK_3DSMAX_x64_2015%python"
SET PYTHONDONTWRITEBYTECODE=TRUE
SET PYTHONPATH="%ADSK_3DSMAX_x64_2015%python";"%ADSK_3DSMAX_x64_2015%python\Lib\site-packages"
SET PATH=%PATH%;%PYTHON%

rd build /s /q

rem Run Build
python setup.py build
echo %PATH%
echo %PYTHONPATH%
echo %PYTHON%
echo Build complete
ENDLOCAL
pause

Save that in a batch file in the same dir as pyzmq. Hope this helps.

Cheers,
Artur Leao

Thank you so much Artur!

I had to add the zmq location to the build command

mayapy setup.py build --zmq=..\zeromq-4.0.4

I also had errors not being able to find the header files for things like pyconfig and the python27.lib

These I found in
Maya2014\include\python2.7
Maya2014\lib

I had to move these into my Maya2014\Python folder under the dirs
Python\include
Python\libs

Is there a way to be able to point to those without moving them?

At any rate I got a new version of PyZMQ to compile for Maya2014 and I’m super stoked!
Going to try to compile one for Maya2013 later.
When I get a chance I’ll throw up binaries for anyone that wants it.

Glad I could help man :slight_smile:

Keep sharing the love! Take care :slight_smile:

hmmm building on Maya2013 gives me a new problem.

C:\Program Files\Autodesk\Maya2013\Python\Lib\site-packages\pyzmq-14.3.1>pyzmq.b
at
Setting environment for using Microsoft Visual Studio 2010 x64 cross tools.
running configure
************************************************
Configure: Autodetecting ZMQ settings...
    Custom ZMQ dir:       ..\zeromq-4.0.4
e:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\amd64\cl.exe /c /nolo
go /Ox /MD /W3 /GS- /DNDEBUG -I..\zeromq-4.0.4\include -Izmq\utils -Izmq\backend
\cython -Izmq\devices /Tcbuild	emp.win-amd64-2.6\Release\scratch\vers.c /Fobuil
d	emp.win-amd64-2.6\Release\scratch\vers.obj
vers.c
e:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\amd64\link.exe /nolog
o /INCREMENTAL:NO /LIBPATH:..\zeromq-4.0.4\lib libzmq.lib build	emp.win-amd64-2
.6\Release\scratch\vers.obj /OUT:build	emp.win-amd64-2.6\Release\scratch\vers.e
xe /MANIFESTFILE:build	emp.win-amd64-2.6\Release\scratch\vers.exe.manifest
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\x64\mt.exe -nologo -mani
fest build	emp.win-amd64-2.6\Release\scratch\vers.exe.manifest -outputresource:
build	emp.win-amd64-2.6\Release\scratch\vers.exe;1

build	emp.win-amd64-2.6\Release\scratch\vers.exe.manifest : general error c1010
070: Failed to load and parse the manifest. The system cannot find the file spec
ified.

error: command 'mt.exe' failed with exit status 31

It fails at the manifest part.
I’ve been searching for awhile. I don’t understand why the manifest isn’t being created.
Any ideas?

Windows binary for ZMQ 14.3.1 on Maya2014 (put into site-packages)

http://sideeffect.cgclay.com/binaries/zmq-14.3.1-maya2014x64.rar