简体   繁体   English

如何在 Inno Setup 中使用 Pip 安装 Python 包

[英]How to install Python packages using Pip in Inno Setup

How to install Python libraries using Pip (for instance requests, jinja2, falcon etc)** in Inno Setup?如何在 Inno Setup 中使用Pip (例如 requests、jinja2、falcon 等)**安装 P​​ython 库?

I know one method to install Python libraries using Pip in Inno Setup (just a sample code in the below):我知道一种在 Inno Setup 中使用 Pip 安装 Python 库的方法(下面只是一个示例代码):

Inno Setup file: Inno 安装文件:

[Files]
FileName: "python_file.py";

python_file.py python_file.py

import subprocess
subprocess.call(["pip", "install", "requests"])

May I know, is there any other way to install Python libraries using Pip in Inno Setup?我可以知道,有没有其他方法可以在 Inno Setup 中使用 Pip 安装 Python 库?

As the pip is a standalone executable, you can execute it as any other executable using the [Run] section :由于pip是一个独立的可执行文件,您可以使用[Run]部分将其作为任何其他可执行文件执行:

[Run]
Filename: "pip.exe"; Parameters: "install requests"; StatusMsg: "Installing requests..."

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM