Run Python3.4 and Python3.7 simultaneously on Linux












0















I have a linux VM with preconfigured Python3.4. I need to have Python3.7 to run my code.



I tried to uninstall Python3.4 but there are some system dependencies, so I kept old version.
Then I downloaded and installed Python3.7.1.tgz (sudo make).



But now I can't access Python 3.7 instance. When I run a "python3" command, Python 3.4 is run, when "python3.7" then I get a "command not found" message.



How do I proceed? Is it okay to have two versions of Python 3 installed on one machine? What with installation packages by "pip"?










share|improve this question




















  • 2





    Have you installed it properly? Just go through this link once serverfault.com/q/918335

    – PRY
    Jan 13 at 15:11











  • @P_Yadav, thank you for the link. It resolved my problem.

    – Jareq
    Jan 13 at 15:42
















0















I have a linux VM with preconfigured Python3.4. I need to have Python3.7 to run my code.



I tried to uninstall Python3.4 but there are some system dependencies, so I kept old version.
Then I downloaded and installed Python3.7.1.tgz (sudo make).



But now I can't access Python 3.7 instance. When I run a "python3" command, Python 3.4 is run, when "python3.7" then I get a "command not found" message.



How do I proceed? Is it okay to have two versions of Python 3 installed on one machine? What with installation packages by "pip"?










share|improve this question




















  • 2





    Have you installed it properly? Just go through this link once serverfault.com/q/918335

    – PRY
    Jan 13 at 15:11











  • @P_Yadav, thank you for the link. It resolved my problem.

    – Jareq
    Jan 13 at 15:42














0












0








0








I have a linux VM with preconfigured Python3.4. I need to have Python3.7 to run my code.



I tried to uninstall Python3.4 but there are some system dependencies, so I kept old version.
Then I downloaded and installed Python3.7.1.tgz (sudo make).



But now I can't access Python 3.7 instance. When I run a "python3" command, Python 3.4 is run, when "python3.7" then I get a "command not found" message.



How do I proceed? Is it okay to have two versions of Python 3 installed on one machine? What with installation packages by "pip"?










share|improve this question
















I have a linux VM with preconfigured Python3.4. I need to have Python3.7 to run my code.



I tried to uninstall Python3.4 but there are some system dependencies, so I kept old version.
Then I downloaded and installed Python3.7.1.tgz (sudo make).



But now I can't access Python 3.7 instance. When I run a "python3" command, Python 3.4 is run, when "python3.7" then I get a "command not found" message.



How do I proceed? Is it okay to have two versions of Python 3 installed on one machine? What with installation packages by "pip"?







linux python python3






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 15 at 13:43









D Manokhin

1056




1056










asked Jan 13 at 14:02









JareqJareq

32




32








  • 2





    Have you installed it properly? Just go through this link once serverfault.com/q/918335

    – PRY
    Jan 13 at 15:11











  • @P_Yadav, thank you for the link. It resolved my problem.

    – Jareq
    Jan 13 at 15:42














  • 2





    Have you installed it properly? Just go through this link once serverfault.com/q/918335

    – PRY
    Jan 13 at 15:11











  • @P_Yadav, thank you for the link. It resolved my problem.

    – Jareq
    Jan 13 at 15:42








2




2





Have you installed it properly? Just go through this link once serverfault.com/q/918335

– PRY
Jan 13 at 15:11





Have you installed it properly? Just go through this link once serverfault.com/q/918335

– PRY
Jan 13 at 15:11













@P_Yadav, thank you for the link. It resolved my problem.

– Jareq
Jan 13 at 15:42





@P_Yadav, thank you for the link. It resolved my problem.

– Jareq
Jan 13 at 15:42










1 Answer
1






active

oldest

votes


















0














I would not recommend manually fiddling around with source code installations and paths. Use pyenv and save yourself the trouble.



All you have to do is:




  • Run the pyenv installer

  • Follow the instructions

  • Install the Python versions you need

  • Choose which Python version you want to use for a given directory, or globally


For example, to install 3.7, check which versions are available:



pyenv install -l | grep 3.7


Then run:



pyenv install 3.7.1


Now, you can choose your Python version:



pyenv global 3.7.1


This switches your python to point to 3.7.1. If you want the system python, run:



pyenv global system


To check which Python versions are available, run pyenv versions.






share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "3"
    };
    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%2fsuperuser.com%2fquestions%2f1393780%2frun-python3-4-and-python3-7-simultaneously-on-linux%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









    0














    I would not recommend manually fiddling around with source code installations and paths. Use pyenv and save yourself the trouble.



    All you have to do is:




    • Run the pyenv installer

    • Follow the instructions

    • Install the Python versions you need

    • Choose which Python version you want to use for a given directory, or globally


    For example, to install 3.7, check which versions are available:



    pyenv install -l | grep 3.7


    Then run:



    pyenv install 3.7.1


    Now, you can choose your Python version:



    pyenv global 3.7.1


    This switches your python to point to 3.7.1. If you want the system python, run:



    pyenv global system


    To check which Python versions are available, run pyenv versions.






    share|improve this answer




























      0














      I would not recommend manually fiddling around with source code installations and paths. Use pyenv and save yourself the trouble.



      All you have to do is:




      • Run the pyenv installer

      • Follow the instructions

      • Install the Python versions you need

      • Choose which Python version you want to use for a given directory, or globally


      For example, to install 3.7, check which versions are available:



      pyenv install -l | grep 3.7


      Then run:



      pyenv install 3.7.1


      Now, you can choose your Python version:



      pyenv global 3.7.1


      This switches your python to point to 3.7.1. If you want the system python, run:



      pyenv global system


      To check which Python versions are available, run pyenv versions.






      share|improve this answer


























        0












        0








        0







        I would not recommend manually fiddling around with source code installations and paths. Use pyenv and save yourself the trouble.



        All you have to do is:




        • Run the pyenv installer

        • Follow the instructions

        • Install the Python versions you need

        • Choose which Python version you want to use for a given directory, or globally


        For example, to install 3.7, check which versions are available:



        pyenv install -l | grep 3.7


        Then run:



        pyenv install 3.7.1


        Now, you can choose your Python version:



        pyenv global 3.7.1


        This switches your python to point to 3.7.1. If you want the system python, run:



        pyenv global system


        To check which Python versions are available, run pyenv versions.






        share|improve this answer













        I would not recommend manually fiddling around with source code installations and paths. Use pyenv and save yourself the trouble.



        All you have to do is:




        • Run the pyenv installer

        • Follow the instructions

        • Install the Python versions you need

        • Choose which Python version you want to use for a given directory, or globally


        For example, to install 3.7, check which versions are available:



        pyenv install -l | grep 3.7


        Then run:



        pyenv install 3.7.1


        Now, you can choose your Python version:



        pyenv global 3.7.1


        This switches your python to point to 3.7.1. If you want the system python, run:



        pyenv global system


        To check which Python versions are available, run pyenv versions.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 15 at 14:02









        slhckslhck

        161k47446468




        161k47446468






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Super User!


            • 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%2fsuperuser.com%2fquestions%2f1393780%2frun-python3-4-and-python3-7-simultaneously-on-linux%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

            flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

            Mangá

             ⁒  ․,‪⁊‑⁙ ⁖, ⁇‒※‌, †,⁖‗‌⁝    ‾‸⁘,‖⁔⁣,⁂‾
”‑,‥–,‬ ,⁀‹⁋‴⁑ ‒ ,‴⁋”‼ ⁨,‷⁔„ ‰′,‐‚ ‥‡‎“‷⁃⁨⁅⁣,⁔
⁇‘⁔⁡⁏⁌⁡‿‶‏⁨ ⁣⁕⁖⁨⁩⁥‽⁀  ‴‬⁜‟ ⁃‣‧⁕‮ …‍⁨‴ ⁩,⁚⁖‫ ,‵ ⁀,‮⁝‣‣ ⁑  ⁂– ․, ‾‽ ‏⁁“⁗‸ ‾… ‹‡⁌⁎‸‘ ‡⁏⁌‪ ‵⁛ ‎⁨ ―⁦⁤⁄⁕