Embedding Python in a C++ self-contained executable

Ah, this is a good hint. Although this is only for Windows 64-bit as far as i can see, right? The project i am working on must be 100% cross-platform, so such a package would be needed for every supported platform and architecture. (I only support Windows and Linux so far, 32 and 64 bit).

Needing to know the micro version is not an issue. As everything is supposed to be reproducible, the full version is specified, and thus only this exact version is going to be used until someone changes it intentionally.

For the sake of completeness, it would be nice to have a zip file for download which includes the files the installer installs, but without being an installer. This should in the best case be available for every installer that is downloadable, on every platform.

… oh wait, aren’t there any linux packages for download? I know that python is installed in almost every system, but the same things apply here, the goal is to streamline everything on every platform. Isn’t there an embedded distro for linux?

For now I am detecting the installed python version and downloading the exact matching embeddable distro and copying it to the target folder, it turned out to be extremely simple. Although i planned to do the exact same thing for linux…

1 Like

pythonx86 and pythonarm64 are also available on Nuget.

Non-Windows platforms are still under development, as mentioned earlier. You’ll want to follow along with PEP 711: PyBI: a standard format for distributing Python Binaries for those.

1 Like

Ahh, I know THAT feeling. Congrats on finding the problem. If you “feel dumb” because it turned out to be something trivially small, remember that there are ten thousand trivially small things that it could have been, and it takes a smart person (and/or a lot of extreme tedium) to figure out WHICH small thing it was!

2 Likes

I’ve read so many explanations on Stack Overflow for this very issue I feel like my eyes are going to start bleeding. Such a simple solution I feel like I may need to pursue an alternative career path lol. Thank you so much; this worked for me having the same issue with pybind11.