Python Forum
Embed and extend Python in c++ without users installing Python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Embed and extend Python in c++ without users installing Python
#1
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)
Reply
#2
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.
Reply
#3
(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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Installing mailjet_rest for Python 3 while Python 2 is installed gw1500se 1 993 Mar-12-2025, 03:48 AM
Last Post: Tishat73
  (Fix it) Extend list with multiple other ones andreimotin 3 744 Aug-12-2024, 07:48 PM
Last Post: Pedroski55
  Embed Matplotlib Graph to Tkinter? dimidgen 0 1,343 Mar-04-2024, 07:40 PM
Last Post: dimidgen
  Trouble with installing python domingo251 2 1,332 Sep-23-2023, 12:03 AM
Last Post: ICanIBB
  Installing python packages in a virtual environment Led_Zeppelin 1 1,588 Aug-15-2023, 08:18 PM
Last Post: deanhystad
  Advice for installing python app from github ? Adi44 6 3,466 Aug-07-2023, 06:34 PM
Last Post: snippsat
  Installing Python 3.8.11 from TGZ File michaelnicol 2 7,634 Jul-07-2023, 08:21 AM
Last Post: DeaD_EyE
  Interactive plots that can be embed in web page mouse9095 1 1,205 Jun-12-2023, 04:51 PM
Last Post: deanhystad
  embed python script in C programm gucio321 0 988 Feb-11-2023, 10:47 AM
Last Post: gucio321
  best way to embed passwords into scripts mikey6785 3 4,271 Aug-31-2022, 08:22 AM
Last Post: DeaD_EyE

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020