如何在 Windows 7 中安装 pywin32 模块

问题描述

我正在尝试安装 pywin32.我是从 sourceforge.net 下载的.当我跑步时

I am trying to install pywin32. I downloaded it from sourceforge.net. When I run

setup.py install

它显示无法找到 vcvarsall.bat".我用谷歌搜索了一下,发现我必须安装 MinGW 并设置路径然后运行

it shows "Unable to find vcvarsall.bat". I Googled about it and found that I have to install MinGW and set path then run

python setup.py build --compiler=mingw32

但它正在显示

Can't find a version in Windows.h

有人可以帮忙吗?(我安装了 Visual Studio 2010 Ultimate 的试用版并安装了 MinGW C 和 C++ 编译器.操作系统:Windows 7.)

Can anybody help? (I have a trial version of Visual Studio 2010 Ultimate installed and MinGW C and C++ compiler installed. Operating system: Windows 7.)

谁能告诉我一个来源,我可以从哪里下载已经在 MinGW 中编译的 Python 二进制文件,所以我不必做所有这些.或者如果我能得到一个已经有 Windows 模块的 python.

Can anybody tell me a source from where I can download Python binaries already compiled in MinGW, so I don't have to do all this. Or if I can get a python which already have Windows modules.


解决方案

你只是想安装它,还是想从源代码构建?

are you just trying to install it, or are you looking to build from source?

如果您只需要安装,最简单的方法是使用此处提供的 MSI 安装程序:

If you just need to install, the easiest way is to use the MSI installers provided here:

http://sourceforge.net/projects/pywin32/files/pywin32/(对于更新版本)

确保您获得正确的版本(匹配 Python 版本、32 位/64 位等)

make sure you get the correct version (matches Python version, 32bit/64bit, etc)

相关文章