适用于 Windows 的二进制 python 包(模块)的无人值守安装
是否没有合理的方法来执行 Windows 二进制 python 包的脚本安装?不幸的是,似乎几个基本的 Windows python 软件包(如 pywin32 和 py2exe)只能以 EXE 形式提供,而不是以 MSI 形式提供(据我所知,只有后者是可编写脚本的)。 Easy_install/pip 似乎也没有用,因为它们显然只找到源包,然后尝试在本地编译,这显然不能令人满意。
我错过了什么吗?
Is there no sane way to peform a scripted install of binary python packages for windows? Unfortunately it seems like several essential windows python packages like pywin32 and py2exe are only available as EXE's not MSI's (and as far as I know only the latter are scriptable). Easy_install/pip also seems no use since they apparently only find source packages and then try to compile locally which is obviously unsatisfactory.
Am I missing something?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您可以在 sourceforge.net/projects/pywin32/files/ 下载 pywin32 的源代码然后自己将其构建为 MSI 文件。因此您需要 setuptools(仅用于构建)。使用命令“setup.py bdist_msi”在“dist”目录中创建 MSI 安装程序。
相同的过程应该适用于所有 Windows 兼容的包。
You can download the source code of pywin32 at sourceforge.net/projects/pywin32/files/ and then build it as MSI file yourself. Therefore you need setuptools (only for building). Use the command "setup.py bdist_msi" to create a MSI installer in the "dist" directory.
The same procedure should work for all Windows-compatible packages.
当前的 easy_install 可以静默安装预构建的“.exe”安装程序,即;
将安装 pywin32。
这也使得可以使用 pip 删除;
卸载 pywin32
Current easy_install can install the pre-build ".exe" installers silently, i.e.;
will install pywin32.
This also enables possibility to remove using pip;
uninstalls pywin32
正如链接的答案中所述,如果安装程序是使用<创建的,则可以成功使用
easy_install
a href="https://docs.python.org/2/library/distutils.html" rel="nofollow noreferrer">distutils。As said in a linked answer you can succeed with using
easy_install
if the installer was created with distutils.如果您想要在 Windows 上进行脚本式自动化安装,请查看 AutoIt。
If you want scripted automation of installs on Windows, look into AutoIt.