Is there a way to get pywin32 to use vcvars32.bat instead of vcvarsall.bat?
So, I'm just trying to build pywin32 on my Windows 7 machine. When running the setup script, I ran into the common error of "Unable to find vcvarsall.bat". I do have Visual C++ installed, so I was somewhat confused. After a bit of searching around, here as well as other sites, I found that the best solution to my problem would probably be to add the path to the batch file right to my path. However, when looking for that path, I realized that, since I have Visual Studio 2010 installed rather than 2008 or earlier, I have a file called "vcvars32.bat" instead of the usual "vavarsall.bat".
Is it possible to get the setup script to use vcvars32? This is probably ridiculous and may reveal how little I know about batch files, but could I perhaps copy and rename the vcvars32.bat file to vcvarsall.bat, or are they too fundamentally different to work 开发者_JAVA百科properly?
Or do I just need to install an older version of Visual Studio? I would really rather not if I could avoid it. I have also been having trouble building with MinGW. Are there any files I need to download first?
Thanks in advance,
Ken
Is there a way to get pywin32 to use vcvars32.bat instead of vcvarsall.bat?
There's no need.
I realized that, since I have Visual Studio 2010 installed rather than 2008 or earlier, I have a file called "vcvars32.bat" instead of the usual "vcvarsall.bat".
You have both and vcvars32.bat
is being used by vcvarsall.bat
. For instance, on the 64 bit Windows typical installation paths for these files in Visual Studio 2010 are
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\vcvars32.bat
Or do I just need to install an older version of Visual Studio?
If you use official Python builds then you have to install an older version - Visual Studio 2008 or 2005 depending on what version of Python you use. That's because these versions of Visual Studio are used to make official Python builds and you have to use the same version of compiler when building C extension modules.
You could write a vcvarsall.bat
which simply
"%~dp0\vcvars32.bat"
runs the vcvars32.bat
in the same folder.
(I think. I haven't touched Windows in what feels like years… happily ☺)
Installing the binary version of pywin32 is much simpler and doesn't require the installation of any c++ compilers. For some reason it isn't easy to find these on the sourceforge website, but it is definitely there. Here is the link to all of the executables for version 2.14: http://sourceforge.net/projects/pywin32/files/pywin32/Build%20214/
精彩评论