Python Forum
Mixing 2 versions of python in one C++ application - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Mixing 2 versions of python in one C++ application (/thread-4459.html)



Mixing 2 versions of python in one C++ application - satya - Aug-18-2017

Hi,

I have a python embedded C++ application, and currently using python 2.7.13.
Now I want to introduce a new component in this application (dll/.so, loaded dynamically), and this new component also uses python, but version 2.5. The functionality that uses python in this new component fails.

My question is, can i have this kind of mix? Can i kind of unload (Py_Finalize and then do Py_SetPythonHome and Path) and load the new component dll which would do its Py_Initialize after doing the Py_SetPythonHome and path to the Python25 folder?

Thanks in advance
Satya