For CMS, I’m trying to build our python stack with python2.7 and python3.6 support (eventually to remove the python2.7…) - From this forum I see work in progress for ROOT supporting multiple python versions (which I guess is a matter of rebuilding one library?), but I haven’t found anything indicating that this work completed.
To rebuild, you probably indeed have no other option than a full rebuild. It used to be possible with the autoconf scripts to simply make clean-pyroot, reconfigure, rebuild only libPyROOT.so, but the cmake scripts regressed AFAICT. Also, it’s no longer just PyROOT, but also PyVMA.
That said, since your p3 is new enough, you can have the two live side-by-side as long as you don’t care about using TPython from root.exe.
What you do is: build first for p3, then move libPyROOT.so to an ABI tagged named. You can find this tag by using:
And same for libPyMVA if you want it. Now save the file(s) somewhere out of the build tree, wipe the build, then start over building for p2. Once fully installed, move that saved ABI tagged p3 file next to libPyROOT.so from p2 in $ROOTSYS/lib and you should be in business.