mhammond/pywin32 源码下载与部署教程

项目概述

Python for Windows (pywin32) Extensions

项目地址

https://github.com/mhammond/pywin32

项目页面预览

mhammond/pywin32 preview

关键指标

  • Stars:5507
  • 主要语言:C++
  • License:未声明
  • 最近更新:2025-12-15T02:53:58Z
  • 默认分支:main

本站高速下载(国内可用)

点击下载(本站镜像)
– SHA256:e5bd75667b0e3fe40649ecb2ca4581b7c362b4a7278a0193b25fdf886b204515

安装部署要点(README 精选)

Installing via PIP

You should install pywin32 via pip – eg,

python -m pip install --upgrade pywin32

There is a post-install script (see below) which should not be run inside virtual environments;
it should only be run in “global” installs.

For unreleased changes, you can download builds made by GitHub actions
choose any “workflow” from the main branch and download its “artifacts”

Installing globally

Outside of a virtual environment you might want to install COM objects, services, etc. You can do
this by executing:

python -m pywin32_postinstall -install

or (shorter but you don’t have control over which python environment is used)

pywin32_postinstall -install

If you do this with normal permissions it will be global for your user (a few files will be
copied to the root of your Python install and some changes made to HKCU). If you execute this from
an elevated process, it will be global for the machine (files will be copied to System32, HKLM
will be changed, etc)

Installing for MingGW/msys2

The folks at https://github.com/msys2/MINGW-packages/tree/master/mingw-w64-python-pywin32 are graciously keeping an updated set of patches to install pywin32 for MingGW/msys2.

We’d suggest installing from https://packages.msys2.org/base/mingw-w64-python-pywin32 pacman -S mingw-w64-python-pywin32.

We’re open to seeing these patches be upstreamed in pywin32 if they can be tested automatically on the CI.

Running as a Windows Service

To run as a service, you probably want to install pywin32 globally from an elevated
command prompt – see above.

You also need to ensure Python is installed in a location where the user running
the service has access to the installation and is able to load pywintypesXX.dll and pythonXX.dll.
In particular, the LocalSystem account typically will not have access to your local %USER% directory structure.

常用命令(从 README 提取)

python -m pip install --upgrade pywin32

python -m pywin32_postinstall -install

pywin32_postinstall -install

通用部署说明

  1. 下载源码并阅读 README
  2. 安装依赖(pip/npm/yarn 等)
  3. 配置环境变量(API Key、模型路径、数据库等)
  4. 启动服务并测试访问
  5. 上线建议:Nginx 反代 + HTTPS + 进程守护(systemd / pm2)

免责声明与版权说明

本文仅做开源项目整理与教程索引,源码版权归原作者所有,请遵循对应 License 合规使用。

© 版权声明
THE END
喜欢就支持一下吧
点赞7 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容