How to replace python 3 installation with python 2.7

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












I already have python3 installed on the server machine, I want to replace that with python 2.7 as the code I have to deploy is complaint with python 2.7.



What command to run so python application.py runs it on python 2.7










share|improve this question







New contributor




SID is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.























    up vote
    1
    down vote

    favorite












    I already have python3 installed on the server machine, I want to replace that with python 2.7 as the code I have to deploy is complaint with python 2.7.



    What command to run so python application.py runs it on python 2.7










    share|improve this question







    New contributor




    SID is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.





















      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I already have python3 installed on the server machine, I want to replace that with python 2.7 as the code I have to deploy is complaint with python 2.7.



      What command to run so python application.py runs it on python 2.7










      share|improve this question







      New contributor




      SID is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      I already have python3 installed on the server machine, I want to replace that with python 2.7 as the code I have to deploy is complaint with python 2.7.



      What command to run so python application.py runs it on python 2.7







      python python-2.7






      share|improve this question







      New contributor




      SID is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question







      New contributor




      SID is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question






      New contributor




      SID is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 1 hour ago









      SID

      61




      61




      New contributor




      SID is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      SID is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      SID is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          2
          down vote













          To control which version of python add this line to top of your script



          #!/usr/bin/env python2


          alternatively execute your python script using your chosen python version



          /usr/bin/python2 /full/path/my/script


          similar steps will enable you to use python3 instead of python2 assuming your script imports are 3






          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',
            convertImagesToLinks: true,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );






            SID is a new contributor. Be nice, and check out our Code of Conduct.









             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1079762%2fhow-to-replace-python-3-installation-with-python-2-7%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            2
            down vote













            To control which version of python add this line to top of your script



            #!/usr/bin/env python2


            alternatively execute your python script using your chosen python version



            /usr/bin/python2 /full/path/my/script


            similar steps will enable you to use python3 instead of python2 assuming your script imports are 3






            share|improve this answer
























              up vote
              2
              down vote













              To control which version of python add this line to top of your script



              #!/usr/bin/env python2


              alternatively execute your python script using your chosen python version



              /usr/bin/python2 /full/path/my/script


              similar steps will enable you to use python3 instead of python2 assuming your script imports are 3






              share|improve this answer






















                up vote
                2
                down vote










                up vote
                2
                down vote









                To control which version of python add this line to top of your script



                #!/usr/bin/env python2


                alternatively execute your python script using your chosen python version



                /usr/bin/python2 /full/path/my/script


                similar steps will enable you to use python3 instead of python2 assuming your script imports are 3






                share|improve this answer












                To control which version of python add this line to top of your script



                #!/usr/bin/env python2


                alternatively execute your python script using your chosen python version



                /usr/bin/python2 /full/path/my/script


                similar steps will enable you to use python3 instead of python2 assuming your script imports are 3







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 48 mins ago









                Scott Stensland

                4,18442239




                4,18442239




















                    SID is a new contributor. Be nice, and check out our Code of Conduct.









                     

                    draft saved


                    draft discarded


















                    SID is a new contributor. Be nice, and check out our Code of Conduct.












                    SID is a new contributor. Be nice, and check out our Code of Conduct.











                    SID is a new contributor. Be nice, and check out our Code of Conduct.













                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1079762%2fhow-to-replace-python-3-installation-with-python-2-7%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Comments

                    Popular posts from this blog

                    What does second last employer means? [closed]

                    Installing NextGIS Connect into QGIS 3?

                    One-line joke