python3 command not found - Ubuntu

Page content

How to Install python3 Command on Ubuntu

If you are using Ubuntu and trying to run the python3 command but encountering a “command not found” error, it means that the Python 3 interpreter is not installed on your system. Python is a popular programming language used for various purposes including web development, data analysis, automation, and more.

Installation Process

To install the python3 command on Ubuntu, follow these steps:

  1. Open a terminal window by pressing Ctrl + Alt + T.

  2. Update the package list to ensure you have the latest information on available packages by running the following command:

    sudo apt update
    
  3. Install the Python 3 interpreter by running the following command:

    sudo apt install python3
    
  4. After the installation is complete, you can verify the installation by running:

    python3 --version
    

Handling Incompatibility Issues

If any of the above commands are not compatible with your Ubuntu version, you can try the following alternatives:

  • For older Ubuntu versions, you may need to use apt-get instead of apt. Replace apt with apt-get in the commands mentioned above.

  • If you encounter any permission issues, you can use sudo at the beginning of each command to execute them with root privileges.

Conclusion

In this tutorial, you have learned how to install the python3 command on Ubuntu to start using the Python 3 interpreter. By following the provided steps, you can now write and run Python scripts on your Ubuntu system without encountering the “command not found” error.