If I launch python --version
from Terminal on macOS
, I'm getting 3.9
version. The same is for python3
.
But if I launch these from my C++ program (I use QProcess
), I'm getting 2.7
for python
and 3.7
for python3
.
Why so?
Is there any way to launch the same python version as terminal launches?
Is there a way to find path to the latest python installed on the machine (I need to support macOS and Linux).
Addition #1. On another macOS machine, there is Python 3.10 installed in /Applications folder.
python3 --version shows expected 3.10 version, but my C++ program does not even see this python3, so macOS displays its system error message which suggests the user to install additional components (which does not work through).