When I tried whereis python it returns me following list:
python: /usr/bin/python3.8 /usr/lib/python3.9 /usr/lib/python2.7 /usr/lib/python3.8 /etc/python2.7 /etc/python3.8 /usr/local/lib/python3.8 /usr/include/python3.8
Does that mean python is already installed in my machine ?
But when I try to yarn install in my project, it returns me following error:
gyp verb cli ]
gyp info using node-gyp@3.8.0
gyp info using node@15.3.0 | linux | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2 1 2 Answers
Your computer has python3.8 installed. To quickly check whether python2 is installed, run the command python2 --version, and your computer will most likely show command not found, because it is most likely not installed in your system.
Use the command sudo apt install python2 to install python2.
Also, in the recent versions of Ubuntu, python2 has to be called with the command python2, not just python.
Warning: Do not try to remove python3, or change the default Python version to 2. python3.8 is preinstalled in your version of Ubuntu, and major components of Ubuntu depend on it. You can safely have both python2 and python3 installed.
You can check using python2 --version for python2 and python3 --version for python3. You can also use which python to verify which python will be used when called. Apparently it is installed in your machine, but yarn could not find it.