I have installed python 2.7 and python 3.7 in my ubuntu 18.04 but when i

type python it shows

  Command 'python' not found, but can be installed with:

  sudo apt install python3       
  sudo apt install python        
  sudo apt install python-minimal

  You also have python3 installed, you can run 'python3' instead.

but i already installed python.

  • 1
    You said you installed both python & python3 ? when they were both already installed (ie. Lubuntu 18.04 LTS comes with both though 3.6 for python3). How did you install them? and did you remove or replace the pre-installed versions? I suspect your issue is $PATH, that you removed the preinstalled versions that were in your path, installed it elsewhere or amended your $PATH to something different to default. – guiverc May 19 at 8:11
  • i installed python 3.7 – Boni May 19 at 8:21
  • I asked HOW you installed them. If you used commands; history can refresh your memory on how. On my Lubuntu a whereis python tells me where it is, and the command echo $PATH shows the list of directories searched for commands. What I suggested may be corrupted on yours, or if you installed from source (why I asked HOW) it could be installed outside of $PATH defaults. If I enter python --version mine responds 2.7.16, and python3 --version responds 3.7.3 (note: I'm not using 18.04 so it's likely later versions). Did you remove anything? and how was it installed? – guiverc May 19 at 12:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.