Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. The Lounge
  4. Install Python on Ubuntu
Forum Updated to NodeBB v4.3 + New Features

Install Python on Ubuntu

Scheduled Pinned Locked Moved Unsolved The Lounge
10 Posts 8 Posters 1.3k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    Gulshan Negi
    Banned
    wrote on last edited by
    #1

    I am trying to install Python 3.9 on my Ubuntu OS, I try to install Python in the following manner
    sudo apt-get install python3.9
    after seems installed I tried checking the version:
    python -V
    However, this input returns:
    -bash: python: command not found
    It seems like Python versions don't fully install.
    Can anyone help me for installation Python on Ubuntu?

    JonBJ 1 Reply Last reply
    0
    • G Gulshan Negi

      I am trying to install Python 3.9 on my Ubuntu OS, I try to install Python in the following manner
      sudo apt-get install python3.9
      after seems installed I tried checking the version:
      python -V
      However, this input returns:
      -bash: python: command not found
      It seems like Python versions don't fully install.
      Can anyone help me for installation Python on Ubuntu?

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @Gulshan-Negi
      It certainly used to be the case that under Ubuntu/Linux generally python attempts to run Python 2.x. To run Python 3.x you are/were supposed to type python3?

      1 Reply Last reply
      1
      • G Offline
        G Offline
        Gulshan Negi
        Banned
        wrote on last edited by
        #3
        This post is deleted!
        JonBJ 1 Reply Last reply
        0
        • G Gulshan Negi

          This post is deleted!

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #4

          @Gulshan-Negi
          I don't really know why you needed to do anything. Ubuntu 20.04+ comes with Python 3 already installed....

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Currently python is by default python2. To ensure you are getting the Python 3 interpreter call python3.

            As for having different versions of python on your system, I would recommend using either virtualenv or conda to manage them rather than system installation. This will allow you to work in isolated environments tailored to the needs of your projects.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • Westley MartinW Offline
              Westley MartinW Offline
              Westley Martin
              Banned
              wrote on last edited by
              #6

              To run Python 3.x you are/were supposed to type python3

              1 Reply Last reply
              0
              • Kent-DorfmanK Offline
                Kent-DorfmanK Offline
                Kent-Dorfman
                wrote on last edited by
                #7

                alternatives is a front end for simply replacing the /usr/bin symlinks. You can make /usr/bin/python point to whatever version you have installed. I'm in upgrade to python3 hell at the moment because I installed debian 11 on my newest workstation and I need to make it backward compatible with bunches of NFS shared python2 programs I run interchangably on other machines. of course many of those apps use python2 specific modules that aren't available in debian11.

                1 Reply Last reply
                0
                • W Offline
                  W Offline
                  woky
                  Banned
                  wrote on last edited by woky
                  #8
                  This post is deleted!
                  1 Reply Last reply
                  0
                  • C Offline
                    C Offline
                    claudiajohnston
                    Banned
                    wrote on last edited by
                    #9
                    This post is deleted!
                    jsulmJ 1 Reply Last reply
                    0
                    • C claudiajohnston

                      This post is deleted!

                      jsulmJ Offline
                      jsulmJ Offline
                      jsulm
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10
                      This post is deleted!
                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved