Results 1 to 9 of 9

Thread: upgrade to newer version of python

  1. #1
    Join Date
    Jan 2011
    Location
    127.0.0.1
    Beans
    153
    Distro
    Ubuntu 14.04 Trusty Tahr

    upgrade to newer version of python

    heres the issue: i am running Python 2.7.17 and not anything newer and more secure. I tried updating python to a 3.x++ a few months ago and was left with 2 installs of python 2.x and 3.x and the interperter wanted to run the oldest version. all versions of ubuntu need to roll out with a working but upgraded version of python by default so it does not ship with insecure packages. https://developers.slashdot.org/stor...-drop-python-2 im on 18.04 how do i remove my current install and put something new like python 3.x +++ there are countless guides on the internet but they all seem to break my install.
    Youtube/user/unguidedone

  2. #2
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    21,307
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: upgrade to newer version of python

    NEVER try to replace the system python2/python3 systems.

    Use something like pyenv to keep your desired python and modules completely separate from the system versions.

  3. #3
    Join Date
    Aug 2011
    Location
    51.8° N 5.8° E
    Beans
    5,466
    Distro
    Xubuntu 20.04 Focal Fossa

    Re: upgrade to newer version of python

    Python 2.7 and Python 3.* are both fully supported. Both get bugfixes if needed and on Ubuntu 18.04 both are installed by default.

    Python 2 scripts are not compatible with the Python 3 interpreter, so while all Python scripts used by Ubuntu get ported to Python 3, both versions of Python must be installed. And as the Python 2 scripts may not explicitly state they need Python 2 (but the Python 3 scripts state that they need Python 3), Python 2 must be the default. You can run Python 3 using the python3 command:
    Code:
    $ python --version
    Python 2.7.17
    $ python3 --version
    Python 3.7.5
    That's on Ubuntu 19.10. You'll get slightly different versions on 18.04, but still with all the critical bugfixes backported.

    Many core components of Ubuntu use Python. When you manually mess with Python, you can easely break Ubuntu. This can also break the tools you would normally use to repair it, so you quickly get to the point that a fresh install is the only sensible option.

  4. #4
    Join Date
    Aug 2006
    Beans
    13,059
    Distro
    Ubuntu Mate 20.04 Focal Fossa

    Re: upgrade to newer version of python

    Here is python3 on 18.04:
    Code:
    python3 --version
    Python 3.6.9

  5. #5
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: upgrade to newer version of python

    With 20.04 there is only python3.
    Code:
    red@fred-Z170N-focal:~$ python --version
    
    Command 'python' not found, did you mean:
    
      command 'python3' from deb python3
      command 'python' from deb python-is-python3
    
    fred@fred-Z170N-focal:~$ python3 --version
    Python 3.8.2
    I still have a couple of apps I typically install that still required python2, but I prevented those from installing the minute they tried to install python2.
    For more info on UEFI boot install & repair - Regularly Updated :
    http://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  6. #6
    Join Date
    Oct 2012
    Location
    Eugene, Or
    Beans
    377
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: upgrade to newer version of python

    With Ubuntu 20.04 Ubuntu CinnamonRemix

    Code:
    craig@craig-Latitude-E6500:~$ python --versionPython 2.7.17
    craig@craig-Latitude-E6500:~$ python3 --version
    Python 3.6.9
    craig@craig-Latitude-E6500:~$
    Last edited by slickymaster; April 10th, 2020 at 03:59 PM. Reason: swapped quote with code tags
    The Answer Please if at all Possible

  7. #7
    Join Date
    Jan 2011
    Location
    127.0.0.1
    Beans
    153
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: upgrade to newer version of python

    Quote Originally Posted by TheFu View Post
    NEVER try to replace the system python2/python3 systems. Use something like pyenv to keep your desired python and modules completely separate from the system versions.
    i tested it in a vm and just broke the install thats why i posted the thread.
    Quote Originally Posted by Impavidus View Post
    Python 2.7 and Python 3.* are both fully supported. Both get bugfixes if needed and on Ubuntu 18.04 both are installed by default. Python 2 scripts are not compatible with the Python 3 interpreter, so while all Python scripts used by Ubuntu get ported to Python 3, both versions of Python must be installed. And as the Python 2 scripts may not explicitly state they need Python 2 (but the Python 3 scripts state that they need Python 3), Python 2 must be the default. You can run Python 3 using the python3 command:
    Code:
    $ python --version Python 2.7.17 $ python3 --version Python 3.7.5
    That's on Ubuntu 19.10. You'll get slightly different versions on 18.04, but still with all the critical bugfixes backported. Many core components of Ubuntu use Python. When you manually mess with Python, you can easely break Ubuntu. This can also break the tools you would normally use to repair it, so you quickly get to the point that a fresh install is the only sensible option.
    thats why i test in a vm and not on my working system
    Quote Originally Posted by oldfred View Post
    With 20.04 there is only python3.
    Code:
    red@fred-Z170N-focal:~$ python --version  Command 'python' not found, did you mean:    command 'python3' from deb python3   command 'python' from deb python-is-python3  fred@fred-Z170N-focal:~$ python3 --version Python 3.8.2
    I still have a couple of apps I typically install that still required python2, but I prevented those from installing the minute they tried to install python2.
    How can i restrict what runs depending on what version of python is running apparmor or selinux profile update of some kind?
    Youtube/user/unguidedone

  8. #8
    Join Date
    Nov 2007
    Location
    London, England
    Beans
    7,079
    Distro
    Xubuntu 20.04 Focal Fossa

    Re: upgrade to newer version of python

    How can i restrict what runs depending on what version of python is running apparmor or selinux profile update of some kind?
    I don't think I understand the question. What are you trying to restrict, and on what basis?

  9. #9
    Join Date
    Jan 2011
    Location
    127.0.0.1
    Beans
    153
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: upgrade to newer version of python

    Ill just need to upgrade from 18.04 -> 20.04 maybe the security issues will be solved. tyvm for the input people much love
    Youtube/user/unguidedone

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •