Setting python3 to version 3.7 on WSL












0















Can I change the default Python 3.6.5 on WSL Ubuntu 18.04 to 3.7? So when I check python3 --version I get 3.7.x so I can use that version with pip3 as well. Thanks



enter image description here










share|improve this question























  • Does python3.7 --version provide the desired output and are you just trying to avoid typing the extra .7? Have you considered virtual environments?

    – DaveStSomeWhere
    Feb 22 at 22:44











  • What I try to do is installing more packages for 3.7, not 3.6 version coming with ubuntu 18.04. PIP3 is associated with 3.6.5 and don't know how to install packages on 3.7

    – wbadry
    Feb 23 at 12:37











  • Yes, multiple steps to verify. 1 - verify python3.7 is installed by checking python3.7 --version. 2 - do you have root privileges, can you enter sudo commands. 3. Find your python3 symbolic link using which python3 (should point to python3.6). 4 - remove python3 symbolic link. 5. Add new symbolic link to python3.7. Please verify 1 and 2.

    – DaveStSomeWhere
    Feb 23 at 14:55











  • Would you kindly post the Linux commands for this?

    – wbadry
    Feb 23 at 22:23











  • I'll put them in an answer to format

    – DaveStSomeWhere
    Feb 24 at 3:34
















0















Can I change the default Python 3.6.5 on WSL Ubuntu 18.04 to 3.7? So when I check python3 --version I get 3.7.x so I can use that version with pip3 as well. Thanks



enter image description here










share|improve this question























  • Does python3.7 --version provide the desired output and are you just trying to avoid typing the extra .7? Have you considered virtual environments?

    – DaveStSomeWhere
    Feb 22 at 22:44











  • What I try to do is installing more packages for 3.7, not 3.6 version coming with ubuntu 18.04. PIP3 is associated with 3.6.5 and don't know how to install packages on 3.7

    – wbadry
    Feb 23 at 12:37











  • Yes, multiple steps to verify. 1 - verify python3.7 is installed by checking python3.7 --version. 2 - do you have root privileges, can you enter sudo commands. 3. Find your python3 symbolic link using which python3 (should point to python3.6). 4 - remove python3 symbolic link. 5. Add new symbolic link to python3.7. Please verify 1 and 2.

    – DaveStSomeWhere
    Feb 23 at 14:55











  • Would you kindly post the Linux commands for this?

    – wbadry
    Feb 23 at 22:23











  • I'll put them in an answer to format

    – DaveStSomeWhere
    Feb 24 at 3:34














0












0








0








Can I change the default Python 3.6.5 on WSL Ubuntu 18.04 to 3.7? So when I check python3 --version I get 3.7.x so I can use that version with pip3 as well. Thanks



enter image description here










share|improve this question














Can I change the default Python 3.6.5 on WSL Ubuntu 18.04 to 3.7? So when I check python3 --version I get 3.7.x so I can use that version with pip3 as well. Thanks



enter image description here







18.04 xubuntu windows-subsystem-for-linux






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Feb 22 at 20:30









wbadrywbadry

1053




1053













  • Does python3.7 --version provide the desired output and are you just trying to avoid typing the extra .7? Have you considered virtual environments?

    – DaveStSomeWhere
    Feb 22 at 22:44











  • What I try to do is installing more packages for 3.7, not 3.6 version coming with ubuntu 18.04. PIP3 is associated with 3.6.5 and don't know how to install packages on 3.7

    – wbadry
    Feb 23 at 12:37











  • Yes, multiple steps to verify. 1 - verify python3.7 is installed by checking python3.7 --version. 2 - do you have root privileges, can you enter sudo commands. 3. Find your python3 symbolic link using which python3 (should point to python3.6). 4 - remove python3 symbolic link. 5. Add new symbolic link to python3.7. Please verify 1 and 2.

    – DaveStSomeWhere
    Feb 23 at 14:55











  • Would you kindly post the Linux commands for this?

    – wbadry
    Feb 23 at 22:23











  • I'll put them in an answer to format

    – DaveStSomeWhere
    Feb 24 at 3:34



















  • Does python3.7 --version provide the desired output and are you just trying to avoid typing the extra .7? Have you considered virtual environments?

    – DaveStSomeWhere
    Feb 22 at 22:44











  • What I try to do is installing more packages for 3.7, not 3.6 version coming with ubuntu 18.04. PIP3 is associated with 3.6.5 and don't know how to install packages on 3.7

    – wbadry
    Feb 23 at 12:37











  • Yes, multiple steps to verify. 1 - verify python3.7 is installed by checking python3.7 --version. 2 - do you have root privileges, can you enter sudo commands. 3. Find your python3 symbolic link using which python3 (should point to python3.6). 4 - remove python3 symbolic link. 5. Add new symbolic link to python3.7. Please verify 1 and 2.

    – DaveStSomeWhere
    Feb 23 at 14:55











  • Would you kindly post the Linux commands for this?

    – wbadry
    Feb 23 at 22:23











  • I'll put them in an answer to format

    – DaveStSomeWhere
    Feb 24 at 3:34

















Does python3.7 --version provide the desired output and are you just trying to avoid typing the extra .7? Have you considered virtual environments?

– DaveStSomeWhere
Feb 22 at 22:44





Does python3.7 --version provide the desired output and are you just trying to avoid typing the extra .7? Have you considered virtual environments?

– DaveStSomeWhere
Feb 22 at 22:44













What I try to do is installing more packages for 3.7, not 3.6 version coming with ubuntu 18.04. PIP3 is associated with 3.6.5 and don't know how to install packages on 3.7

– wbadry
Feb 23 at 12:37





What I try to do is installing more packages for 3.7, not 3.6 version coming with ubuntu 18.04. PIP3 is associated with 3.6.5 and don't know how to install packages on 3.7

– wbadry
Feb 23 at 12:37













Yes, multiple steps to verify. 1 - verify python3.7 is installed by checking python3.7 --version. 2 - do you have root privileges, can you enter sudo commands. 3. Find your python3 symbolic link using which python3 (should point to python3.6). 4 - remove python3 symbolic link. 5. Add new symbolic link to python3.7. Please verify 1 and 2.

– DaveStSomeWhere
Feb 23 at 14:55





Yes, multiple steps to verify. 1 - verify python3.7 is installed by checking python3.7 --version. 2 - do you have root privileges, can you enter sudo commands. 3. Find your python3 symbolic link using which python3 (should point to python3.6). 4 - remove python3 symbolic link. 5. Add new symbolic link to python3.7. Please verify 1 and 2.

– DaveStSomeWhere
Feb 23 at 14:55













Would you kindly post the Linux commands for this?

– wbadry
Feb 23 at 22:23





Would you kindly post the Linux commands for this?

– wbadry
Feb 23 at 22:23













I'll put them in an answer to format

– DaveStSomeWhere
Feb 24 at 3:34





I'll put them in an answer to format

– DaveStSomeWhere
Feb 24 at 3:34










1 Answer
1






active

oldest

votes


















1














Here's the steps to change your python3 command to point to your python3.7 version (assuming you already have 3.7 installed). Please adjust paths as needed for your environment



# 1 - Identify your location of `python3` using the `which` command
which python3
# returns something like
/usr/local/bin/python3

# 2 - Identify your location of `python3.7` using the `which` command
which python3.7
# returns something like
/usr/local/bin/python3.7

# 3 - Get directory listing of python3 folder (from 1 above)
# using grep to filter results containing 'python'
ll /usr/local/bin | grep -i python
# returns something like below - notice the arrow after python3
# the arrow indicates a symbolic link
lrwxrwxrwx 1 root root 18 Jul 4 2018 python3 -> /usr/bin/python3.6*
-rwxr-xr-x 2 root root 14777608 Nov 3 00:36 python3.7*
-rwxr-xr-x 2 root root 14777608 Nov 3 00:36 python3.7m*
-rwxr-xr-x 1 root root 3097 Nov 3 00:37 python3.7m-config*
-rwxr-xr-x 1 root root 4522328 Feb 22 17:24 python3x*

# 4 - Test creating a symbolic link using sudo to get root privileges
# enter password if/when prompted
sudo ln -s /usr/local/bin/python3.7 /usr/local/bin/test37

# 4 - verify test
test37 --version
# Desired output
Python 3.7.1

# 5 - remove test and python3
sudo rm /usr/local/bin/test37
sudo rm /usr/local/bin/python3

# 6 - creating python3 symbolic link using sudo to get root privileges
# enter password if/when prompted
sudo ln -s /usr/local/bin/python3.7 /usr/local/bin/python3

# 7 - verify
python3 --version
# Desired output
Python 3.7.1


Of course the pythonic thing to do is to use virtual environments.






share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "89"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1120474%2fsetting-python3-to-version-3-7-on-wsl%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    Here's the steps to change your python3 command to point to your python3.7 version (assuming you already have 3.7 installed). Please adjust paths as needed for your environment



    # 1 - Identify your location of `python3` using the `which` command
    which python3
    # returns something like
    /usr/local/bin/python3

    # 2 - Identify your location of `python3.7` using the `which` command
    which python3.7
    # returns something like
    /usr/local/bin/python3.7

    # 3 - Get directory listing of python3 folder (from 1 above)
    # using grep to filter results containing 'python'
    ll /usr/local/bin | grep -i python
    # returns something like below - notice the arrow after python3
    # the arrow indicates a symbolic link
    lrwxrwxrwx 1 root root 18 Jul 4 2018 python3 -> /usr/bin/python3.6*
    -rwxr-xr-x 2 root root 14777608 Nov 3 00:36 python3.7*
    -rwxr-xr-x 2 root root 14777608 Nov 3 00:36 python3.7m*
    -rwxr-xr-x 1 root root 3097 Nov 3 00:37 python3.7m-config*
    -rwxr-xr-x 1 root root 4522328 Feb 22 17:24 python3x*

    # 4 - Test creating a symbolic link using sudo to get root privileges
    # enter password if/when prompted
    sudo ln -s /usr/local/bin/python3.7 /usr/local/bin/test37

    # 4 - verify test
    test37 --version
    # Desired output
    Python 3.7.1

    # 5 - remove test and python3
    sudo rm /usr/local/bin/test37
    sudo rm /usr/local/bin/python3

    # 6 - creating python3 symbolic link using sudo to get root privileges
    # enter password if/when prompted
    sudo ln -s /usr/local/bin/python3.7 /usr/local/bin/python3

    # 7 - verify
    python3 --version
    # Desired output
    Python 3.7.1


    Of course the pythonic thing to do is to use virtual environments.






    share|improve this answer




























      1














      Here's the steps to change your python3 command to point to your python3.7 version (assuming you already have 3.7 installed). Please adjust paths as needed for your environment



      # 1 - Identify your location of `python3` using the `which` command
      which python3
      # returns something like
      /usr/local/bin/python3

      # 2 - Identify your location of `python3.7` using the `which` command
      which python3.7
      # returns something like
      /usr/local/bin/python3.7

      # 3 - Get directory listing of python3 folder (from 1 above)
      # using grep to filter results containing 'python'
      ll /usr/local/bin | grep -i python
      # returns something like below - notice the arrow after python3
      # the arrow indicates a symbolic link
      lrwxrwxrwx 1 root root 18 Jul 4 2018 python3 -> /usr/bin/python3.6*
      -rwxr-xr-x 2 root root 14777608 Nov 3 00:36 python3.7*
      -rwxr-xr-x 2 root root 14777608 Nov 3 00:36 python3.7m*
      -rwxr-xr-x 1 root root 3097 Nov 3 00:37 python3.7m-config*
      -rwxr-xr-x 1 root root 4522328 Feb 22 17:24 python3x*

      # 4 - Test creating a symbolic link using sudo to get root privileges
      # enter password if/when prompted
      sudo ln -s /usr/local/bin/python3.7 /usr/local/bin/test37

      # 4 - verify test
      test37 --version
      # Desired output
      Python 3.7.1

      # 5 - remove test and python3
      sudo rm /usr/local/bin/test37
      sudo rm /usr/local/bin/python3

      # 6 - creating python3 symbolic link using sudo to get root privileges
      # enter password if/when prompted
      sudo ln -s /usr/local/bin/python3.7 /usr/local/bin/python3

      # 7 - verify
      python3 --version
      # Desired output
      Python 3.7.1


      Of course the pythonic thing to do is to use virtual environments.






      share|improve this answer


























        1












        1








        1







        Here's the steps to change your python3 command to point to your python3.7 version (assuming you already have 3.7 installed). Please adjust paths as needed for your environment



        # 1 - Identify your location of `python3` using the `which` command
        which python3
        # returns something like
        /usr/local/bin/python3

        # 2 - Identify your location of `python3.7` using the `which` command
        which python3.7
        # returns something like
        /usr/local/bin/python3.7

        # 3 - Get directory listing of python3 folder (from 1 above)
        # using grep to filter results containing 'python'
        ll /usr/local/bin | grep -i python
        # returns something like below - notice the arrow after python3
        # the arrow indicates a symbolic link
        lrwxrwxrwx 1 root root 18 Jul 4 2018 python3 -> /usr/bin/python3.6*
        -rwxr-xr-x 2 root root 14777608 Nov 3 00:36 python3.7*
        -rwxr-xr-x 2 root root 14777608 Nov 3 00:36 python3.7m*
        -rwxr-xr-x 1 root root 3097 Nov 3 00:37 python3.7m-config*
        -rwxr-xr-x 1 root root 4522328 Feb 22 17:24 python3x*

        # 4 - Test creating a symbolic link using sudo to get root privileges
        # enter password if/when prompted
        sudo ln -s /usr/local/bin/python3.7 /usr/local/bin/test37

        # 4 - verify test
        test37 --version
        # Desired output
        Python 3.7.1

        # 5 - remove test and python3
        sudo rm /usr/local/bin/test37
        sudo rm /usr/local/bin/python3

        # 6 - creating python3 symbolic link using sudo to get root privileges
        # enter password if/when prompted
        sudo ln -s /usr/local/bin/python3.7 /usr/local/bin/python3

        # 7 - verify
        python3 --version
        # Desired output
        Python 3.7.1


        Of course the pythonic thing to do is to use virtual environments.






        share|improve this answer













        Here's the steps to change your python3 command to point to your python3.7 version (assuming you already have 3.7 installed). Please adjust paths as needed for your environment



        # 1 - Identify your location of `python3` using the `which` command
        which python3
        # returns something like
        /usr/local/bin/python3

        # 2 - Identify your location of `python3.7` using the `which` command
        which python3.7
        # returns something like
        /usr/local/bin/python3.7

        # 3 - Get directory listing of python3 folder (from 1 above)
        # using grep to filter results containing 'python'
        ll /usr/local/bin | grep -i python
        # returns something like below - notice the arrow after python3
        # the arrow indicates a symbolic link
        lrwxrwxrwx 1 root root 18 Jul 4 2018 python3 -> /usr/bin/python3.6*
        -rwxr-xr-x 2 root root 14777608 Nov 3 00:36 python3.7*
        -rwxr-xr-x 2 root root 14777608 Nov 3 00:36 python3.7m*
        -rwxr-xr-x 1 root root 3097 Nov 3 00:37 python3.7m-config*
        -rwxr-xr-x 1 root root 4522328 Feb 22 17:24 python3x*

        # 4 - Test creating a symbolic link using sudo to get root privileges
        # enter password if/when prompted
        sudo ln -s /usr/local/bin/python3.7 /usr/local/bin/test37

        # 4 - verify test
        test37 --version
        # Desired output
        Python 3.7.1

        # 5 - remove test and python3
        sudo rm /usr/local/bin/test37
        sudo rm /usr/local/bin/python3

        # 6 - creating python3 symbolic link using sudo to get root privileges
        # enter password if/when prompted
        sudo ln -s /usr/local/bin/python3.7 /usr/local/bin/python3

        # 7 - verify
        python3 --version
        # Desired output
        Python 3.7.1


        Of course the pythonic thing to do is to use virtual environments.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Feb 24 at 4:12









        DaveStSomeWhereDaveStSomeWhere

        1363




        1363






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Ask Ubuntu!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1120474%2fsetting-python3-to-version-3-7-on-wsl%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Mouse cursor on multiple screens with different PPI

            Agildo Ribeiro

            Sometime when accessing a menu: “Ubuntu 16.04 has experienced an internal error”