Pytest-3.3.2 using python 2.7











up vote
0
down vote

favorite












I have just installed Ubuntu for WSL, mainly to be able to use linux commands while i learn coding in python, and in particular git and pytest.
I installed pytest using the bash shell, and even though i have python 3.7 installed, when running pytest, it uses python 2.7:



Python 2.7.15rc1, pytest-3.3.2



when running pytest from windows CMD, it runs a different version of pytest python 3.7



Python 3.7.0, pytest-3.10.0



i realise this could be a very stupid question, but this is my first foray into linux based apps, and i would like to know how i can run pytest with the latest python version from the bash shell. I read some posts and have already tried:



python3 -m pytest



python3.7 -m pytest



but get the following message:



/usr/bin/python3: No module named pytest



Can somebody help me please?



thank you










share|improve this question


























    up vote
    0
    down vote

    favorite












    I have just installed Ubuntu for WSL, mainly to be able to use linux commands while i learn coding in python, and in particular git and pytest.
    I installed pytest using the bash shell, and even though i have python 3.7 installed, when running pytest, it uses python 2.7:



    Python 2.7.15rc1, pytest-3.3.2



    when running pytest from windows CMD, it runs a different version of pytest python 3.7



    Python 3.7.0, pytest-3.10.0



    i realise this could be a very stupid question, but this is my first foray into linux based apps, and i would like to know how i can run pytest with the latest python version from the bash shell. I read some posts and have already tried:



    python3 -m pytest



    python3.7 -m pytest



    but get the following message:



    /usr/bin/python3: No module named pytest



    Can somebody help me please?



    thank you










    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I have just installed Ubuntu for WSL, mainly to be able to use linux commands while i learn coding in python, and in particular git and pytest.
      I installed pytest using the bash shell, and even though i have python 3.7 installed, when running pytest, it uses python 2.7:



      Python 2.7.15rc1, pytest-3.3.2



      when running pytest from windows CMD, it runs a different version of pytest python 3.7



      Python 3.7.0, pytest-3.10.0



      i realise this could be a very stupid question, but this is my first foray into linux based apps, and i would like to know how i can run pytest with the latest python version from the bash shell. I read some posts and have already tried:



      python3 -m pytest



      python3.7 -m pytest



      but get the following message:



      /usr/bin/python3: No module named pytest



      Can somebody help me please?



      thank you










      share|improve this question













      I have just installed Ubuntu for WSL, mainly to be able to use linux commands while i learn coding in python, and in particular git and pytest.
      I installed pytest using the bash shell, and even though i have python 3.7 installed, when running pytest, it uses python 2.7:



      Python 2.7.15rc1, pytest-3.3.2



      when running pytest from windows CMD, it runs a different version of pytest python 3.7



      Python 3.7.0, pytest-3.10.0



      i realise this could be a very stupid question, but this is my first foray into linux based apps, and i would like to know how i can run pytest with the latest python version from the bash shell. I read some posts and have already tried:



      python3 -m pytest



      python3.7 -m pytest



      but get the following message:



      /usr/bin/python3: No module named pytest



      Can somebody help me please?



      thank you







      ubuntu pytest windows-subsystem-for-linux






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 10 at 16:48









      learning to code

      1




      1
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          thank you



          in fact i did the following and it worked:




          • apt install python 3 pip

          • sudo apt install python3-test


          after that, it will refer to the latest python version when calling pytest




          • python -m pytest -v






          share|improve this answer








          New contributor




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


















            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            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: 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%2fstackoverflow.com%2fquestions%2f53241171%2fpytest-3-3-2-using-python-2-7%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








            up vote
            0
            down vote













            thank you



            in fact i did the following and it worked:




            • apt install python 3 pip

            • sudo apt install python3-test


            after that, it will refer to the latest python version when calling pytest




            • python -m pytest -v






            share|improve this answer








            New contributor




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






















              up vote
              0
              down vote













              thank you



              in fact i did the following and it worked:




              • apt install python 3 pip

              • sudo apt install python3-test


              after that, it will refer to the latest python version when calling pytest




              • python -m pytest -v






              share|improve this answer








              New contributor




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




















                up vote
                0
                down vote










                up vote
                0
                down vote









                thank you



                in fact i did the following and it worked:




                • apt install python 3 pip

                • sudo apt install python3-test


                after that, it will refer to the latest python version when calling pytest




                • python -m pytest -v






                share|improve this answer








                New contributor




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









                thank you



                in fact i did the following and it worked:




                • apt install python 3 pip

                • sudo apt install python3-test


                after that, it will refer to the latest python version when calling pytest




                • python -m pytest -v







                share|improve this answer








                New contributor




                learning to code 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 answer



                share|improve this answer






                New contributor




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









                answered Nov 11 at 17:15









                learning to code

                1




                1




                New contributor




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





                New contributor





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






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






























                     

                    draft saved


                    draft discarded



















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53241171%2fpytest-3-3-2-using-python-2-7%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

                    Full-time equivalent

                    さくらももこ

                    13 indicted, 8 arrested in Calif. drug cartel investigation