Python 2 interpreter instead of 3 in Geany

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








up vote
0
down vote

favorite












On my PC, Python 2 and 3 are installed – a query of the versions, using the terminal, outputs the following:



$ python2 --version 
Python 2.7.14

$ python3 --version
Python 3.6.3


I would like to learn Python 3, and I use Geany under Xubuntu 17.10 as my development environment. The shebang line reads as follows:



#!/usr/bin/env python3


I do a query for the python version in my little program, the output tells me that Python 2 interpreter is used:



print(sys.version_info)
sys.version_info(major=2, minor=7, micro=14, releaselevel='final', serial=0)


How can that be, as I specify Python 3 in the Shebang? I also wrote the path to the Python 3 interpreter there, but that did not help.



So, here’s my concrete question: How can I achieve that my program gets interpreted by Python 3, and not 2? I could not find an answer in the WWW – I seem to be the only person having this problem. Deinstalling Python 2 is no option, as many applications need this version 2. For any hints where I could start; I’d be very thankful.










share|improve this question



























    up vote
    0
    down vote

    favorite












    On my PC, Python 2 and 3 are installed – a query of the versions, using the terminal, outputs the following:



    $ python2 --version 
    Python 2.7.14

    $ python3 --version
    Python 3.6.3


    I would like to learn Python 3, and I use Geany under Xubuntu 17.10 as my development environment. The shebang line reads as follows:



    #!/usr/bin/env python3


    I do a query for the python version in my little program, the output tells me that Python 2 interpreter is used:



    print(sys.version_info)
    sys.version_info(major=2, minor=7, micro=14, releaselevel='final', serial=0)


    How can that be, as I specify Python 3 in the Shebang? I also wrote the path to the Python 3 interpreter there, but that did not help.



    So, here’s my concrete question: How can I achieve that my program gets interpreted by Python 3, and not 2? I could not find an answer in the WWW – I seem to be the only person having this problem. Deinstalling Python 2 is no option, as many applications need this version 2. For any hints where I could start; I’d be very thankful.










    share|improve this question

























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      On my PC, Python 2 and 3 are installed – a query of the versions, using the terminal, outputs the following:



      $ python2 --version 
      Python 2.7.14

      $ python3 --version
      Python 3.6.3


      I would like to learn Python 3, and I use Geany under Xubuntu 17.10 as my development environment. The shebang line reads as follows:



      #!/usr/bin/env python3


      I do a query for the python version in my little program, the output tells me that Python 2 interpreter is used:



      print(sys.version_info)
      sys.version_info(major=2, minor=7, micro=14, releaselevel='final', serial=0)


      How can that be, as I specify Python 3 in the Shebang? I also wrote the path to the Python 3 interpreter there, but that did not help.



      So, here’s my concrete question: How can I achieve that my program gets interpreted by Python 3, and not 2? I could not find an answer in the WWW – I seem to be the only person having this problem. Deinstalling Python 2 is no option, as many applications need this version 2. For any hints where I could start; I’d be very thankful.










      share|improve this question















      On my PC, Python 2 and 3 are installed – a query of the versions, using the terminal, outputs the following:



      $ python2 --version 
      Python 2.7.14

      $ python3 --version
      Python 3.6.3


      I would like to learn Python 3, and I use Geany under Xubuntu 17.10 as my development environment. The shebang line reads as follows:



      #!/usr/bin/env python3


      I do a query for the python version in my little program, the output tells me that Python 2 interpreter is used:



      print(sys.version_info)
      sys.version_info(major=2, minor=7, micro=14, releaselevel='final', serial=0)


      How can that be, as I specify Python 3 in the Shebang? I also wrote the path to the Python 3 interpreter there, but that did not help.



      So, here’s my concrete question: How can I achieve that my program gets interpreted by Python 3, and not 2? I could not find an answer in the WWW – I seem to be the only person having this problem. Deinstalling Python 2 is no option, as many applications need this version 2. For any hints where I could start; I’d be very thankful.







      python python3 geany shebang






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Feb 18 at 0:14









      wjandrea

      7,24342256




      7,24342256










      asked Feb 17 at 21:22









      Torsten_K

      363




      363




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote













          You have to modify the file /usr/share/geany/filetypes.python by
          replacing the 2 occurrences of <=python> with <=python3>:



          sudo sed -i 's/=python/=python3/g' /usr/share/geany/filetypes.python





          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
            );



            );













             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1007196%2fpython-2-interpreter-instead-of-3-in-geany%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
            1
            down vote













            You have to modify the file /usr/share/geany/filetypes.python by
            replacing the 2 occurrences of <=python> with <=python3>:



            sudo sed -i 's/=python/=python3/g' /usr/share/geany/filetypes.python





            share|improve this answer


























              up vote
              1
              down vote













              You have to modify the file /usr/share/geany/filetypes.python by
              replacing the 2 occurrences of <=python> with <=python3>:



              sudo sed -i 's/=python/=python3/g' /usr/share/geany/filetypes.python





              share|improve this answer
























                up vote
                1
                down vote










                up vote
                1
                down vote









                You have to modify the file /usr/share/geany/filetypes.python by
                replacing the 2 occurrences of <=python> with <=python3>:



                sudo sed -i 's/=python/=python3/g' /usr/share/geany/filetypes.python





                share|improve this answer














                You have to modify the file /usr/share/geany/filetypes.python by
                replacing the 2 occurrences of <=python> with <=python3>:



                sudo sed -i 's/=python/=python3/g' /usr/share/geany/filetypes.python






                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Feb 18 at 14:56









                jokerdino♦

                32k21118185




                32k21118185










                answered Feb 18 at 12:32









                Jean Xana

                112




                112



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1007196%2fpython-2-interpreter-instead-of-3-in-geany%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Popular posts from this blog

                    How do so many people here on Academia.SE, and in general, afford lavish higher education programs?

                    Trouble downloading packages list due to a “Hash sum mismatch” error

                    How do I move numbers in filenames, in a batch renaming operation?