Python Forum

Full Version: Embed and extend Python in c++ without users installing Python
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm trying to embed Python in my C++ program so users can run their Python scripts (with my python extensions) at runtime, but this requires them to have Python installed and have python27.dll at runtime.

How can I do this without forcing them to install Python2.7?

Alternatively, where does python27.dll look to load Python at runtime? Can I supply the python libraries in my installed directory and have my local copy of python27.dll use them instead of looking for a system-wide installation (which is usually in C:\Python27)

As another option, can I have an entire Python system statically linked to my dll?

Thanks in advance!

(also posted to Stack Overflow - https://stackoverflow.com/questions/4844...ing-python)
you should use python36.dll: https://docs.python.org/3/using/windows.html
It's been a while since I've used C++, but I seem to recall linking the dll in with my C++ code.
(Jan-25-2018, 12:37 PM)Larz60+ Wrote: [ -> ]you should use python36.dll: https://docs.python.org/3/using/windows.html
It's been a while since I've used C++, but I seem to recall linking the dll in with my C++ code.

Thanks, but I don't think that helps answer my question. Also, Python2.7 is what needs to be embedded, not Python3.