简体   繁体   中英

How do I distribute Python with a .Net application as one installation executable?

I have a .NET application written in C#, on Visual Studio, that calls some Python scripts to run data through some Machine Learning scripts, models and processes.

I have a requirement to distribute the software as a single installation package/executable onto Windows platform machines that may not have either python nor .NET runtime libraries installed.

Distribution of either a .NET application or a Python application (to include the Python runtimes) appears to be well documented, but how do I marry the two?

Note: It does not matter whether the final installation executable is produced by Python or .NET (Visual Studio) only that it is distributed as one installation package/executable.

I do not have experience with C#, but you could try to compile the python script using pyinstaller , which compiles python code to a stand-alone executable.

Then, you can try embedding this executable into your C# program, as discussed here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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