Results 1 to 5 of 5

Thread: Switching Python Version in 18.04

  1. #1
    Join Date
    Mar 2020
    Beans
    1

    Question Switching Python Version in 18.04

    Hi everyone,

    Ubuntu installed Python in the system and the terminal is using 2.6 by default.
    Can I replace the python command version from 2.6 to version 3.8(download from apt) instead of 3.6(built-in)?

    Would this cause any issue to the Ubuntu OS?

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

    Re: Switching Python Version in 18.04

    Don't do that. The OS expects the OS version of python, ruby, perl to be untouched.

    You can use pyenv to load a different python version and use it as needed, when needed, however. There are other tools and methods similar to pyenv too.
    Code:
    $ pyenv shims
    /home/tf/.pyenv/shims/idle
    /home/tf/.pyenv/shims/idle3
    /home/tf/.pyenv/shims/idle3.6
    /home/tf/.pyenv/shims/pip
    /home/tf/.pyenv/shims/pip3
    /home/tf/.pyenv/shims/pip3.6
    /home/tf/.pyenv/shims/python
    /home/tf/.pyenv/shims/python3
    /home/tf/.pyenv/shims/python3.6
    /home/tf/.pyenv/shims/python3.6m
    /home/tf/.pyenv/shims/python-config
    /home/tf/.pyenv/shims/pyvenv
    /home/tf/.pyenv/shims/pyvenv-3.6
    
    $ which python
    /home/tf/.pyenv/shims/python
    $ python --version
    Python 2.7.12
    $ which python3
    /home/tf/.pyenv/shims/python3
    R$ python3 --version
    Python 3.5.2
    Seems like your system is out of date. Have you patched the OS in a year? I'm running 16.04 and have
    Code:
    $ /usr/bin/python --version
    Python 2.7.12
    Seems that 18.04 would have at least that version.

  3. #3
    Join Date
    May 2013
    Location
    Galiza
    Beans
    796
    Distro
    Ubuntu

    Re: Switching Python Version in 18.04

    Code:
    Python 2.7.17 + Python 3.7.5
    in a fully updated Ubuntu 19.10.

  4. #4
    Join Date
    Jun 2006
    Location
    UK
    Beans
    Hidden!
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: Switching Python Version in 18.04

    Support, not chat.

    Thread moved to General Help.
    Ubuntu 16.04 Desktop Guide - Ubuntu 18.04 Desktop Guide - Forum Guide to BBCode - Using BBCode code tags - IRC #ubuntuforums

    Member: Not Canonical Team

    Please do not PM me about your forum account unless you have been asked to. The correct place to contact an admin about your account is here.

  5. #5
    Join Date
    Oct 2009
    Location
    Reykjavík, Ísland
    Beans
    13,544
    Distro
    Xubuntu 19.10 Eoan Ermine

    Re: Switching Python Version in 18.04

    Quote Originally Posted by CelticWarrior View Post
    Code:
    Python 2.7.17 + Python 3.7.5
    in a fully updated Ubuntu 19.10.
    +1
    Much easier to select a suitable Ubuntu version than trying to modify 18.04.
    Bringing old hardware back to life. About problems due to upgrading.
    Please visit Quick Links -> Unanswered Posts.
    Don't use this space for a list of your hardware. It only creates false hits in the search engines.

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
  •