No module named 'numpy'












6















Actually I am shifting from Windows to Linux. Using pycharm on Windows I have a python 3 script that requires numpy and matplotlib to run, so I installed them on my Linux system using



sudo apt-get install python3-numpy
sudo apt-get install matplotlib3-numpy


But still when I try to run the script I get error:



from python3-numpy import  *
^
SyntaxError: invalid syntax


or:



from numpy import  *
ImportError: No module named 'numpy'









share|improve this question

























  • do you try sudo apt-get install python-matplotlib before sudo apt-get install python3-numpy??

    – Nadimul De Cj
    Mar 22 '16 at 11:27











  • yes @NadimulDeCj, retyping it says - "python-matplotlib is already the newest version."

    – rjbir
    Mar 22 '16 at 11:29






  • 2





    Are you sure you don't use python to run the file with "from numpy import *"? Many computers link python to Python 2.7 and python3 to Python 3

    – ArcaneDominion
    Mar 22 '16 at 11:42
















6















Actually I am shifting from Windows to Linux. Using pycharm on Windows I have a python 3 script that requires numpy and matplotlib to run, so I installed them on my Linux system using



sudo apt-get install python3-numpy
sudo apt-get install matplotlib3-numpy


But still when I try to run the script I get error:



from python3-numpy import  *
^
SyntaxError: invalid syntax


or:



from numpy import  *
ImportError: No module named 'numpy'









share|improve this question

























  • do you try sudo apt-get install python-matplotlib before sudo apt-get install python3-numpy??

    – Nadimul De Cj
    Mar 22 '16 at 11:27











  • yes @NadimulDeCj, retyping it says - "python-matplotlib is already the newest version."

    – rjbir
    Mar 22 '16 at 11:29






  • 2





    Are you sure you don't use python to run the file with "from numpy import *"? Many computers link python to Python 2.7 and python3 to Python 3

    – ArcaneDominion
    Mar 22 '16 at 11:42














6












6








6


3






Actually I am shifting from Windows to Linux. Using pycharm on Windows I have a python 3 script that requires numpy and matplotlib to run, so I installed them on my Linux system using



sudo apt-get install python3-numpy
sudo apt-get install matplotlib3-numpy


But still when I try to run the script I get error:



from python3-numpy import  *
^
SyntaxError: invalid syntax


or:



from numpy import  *
ImportError: No module named 'numpy'









share|improve this question
















Actually I am shifting from Windows to Linux. Using pycharm on Windows I have a python 3 script that requires numpy and matplotlib to run, so I installed them on my Linux system using



sudo apt-get install python3-numpy
sudo apt-get install matplotlib3-numpy


But still when I try to run the script I get error:



from python3-numpy import  *
^
SyntaxError: invalid syntax


or:



from numpy import  *
ImportError: No module named 'numpy'






python3 numpy matplotlib






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Aug 31 '16 at 11:00









Kevin Bowen

14.7k155970




14.7k155970










asked Mar 22 '16 at 11:15









rjbirrjbir

33113




33113













  • do you try sudo apt-get install python-matplotlib before sudo apt-get install python3-numpy??

    – Nadimul De Cj
    Mar 22 '16 at 11:27











  • yes @NadimulDeCj, retyping it says - "python-matplotlib is already the newest version."

    – rjbir
    Mar 22 '16 at 11:29






  • 2





    Are you sure you don't use python to run the file with "from numpy import *"? Many computers link python to Python 2.7 and python3 to Python 3

    – ArcaneDominion
    Mar 22 '16 at 11:42



















  • do you try sudo apt-get install python-matplotlib before sudo apt-get install python3-numpy??

    – Nadimul De Cj
    Mar 22 '16 at 11:27











  • yes @NadimulDeCj, retyping it says - "python-matplotlib is already the newest version."

    – rjbir
    Mar 22 '16 at 11:29






  • 2





    Are you sure you don't use python to run the file with "from numpy import *"? Many computers link python to Python 2.7 and python3 to Python 3

    – ArcaneDominion
    Mar 22 '16 at 11:42

















do you try sudo apt-get install python-matplotlib before sudo apt-get install python3-numpy??

– Nadimul De Cj
Mar 22 '16 at 11:27





do you try sudo apt-get install python-matplotlib before sudo apt-get install python3-numpy??

– Nadimul De Cj
Mar 22 '16 at 11:27













yes @NadimulDeCj, retyping it says - "python-matplotlib is already the newest version."

– rjbir
Mar 22 '16 at 11:29





yes @NadimulDeCj, retyping it says - "python-matplotlib is already the newest version."

– rjbir
Mar 22 '16 at 11:29




2




2





Are you sure you don't use python to run the file with "from numpy import *"? Many computers link python to Python 2.7 and python3 to Python 3

– ArcaneDominion
Mar 22 '16 at 11:42





Are you sure you don't use python to run the file with "from numpy import *"? Many computers link python to Python 2.7 and python3 to Python 3

– ArcaneDominion
Mar 22 '16 at 11:42










3 Answers
3






active

oldest

votes


















8














You need to install numpy using pip

install pip :



sudo apt-get install python-pip python3-pip


Then install numpy using pip



sudo pip3 install -U numpy





share|improve this answer

































    2














    Are you sure that you run python3 and not just python, which defaults to python2.7 on most systems.



    You can get the Version of python with



    python --version


    or



    python3 --version





    share|improve this answer































      0














      If the other answer didn't work for you, try:



      sudo apt-get update; sudo apt-get install python-pip python3-pip
      sudo pip install numpy; sudo pip3 install numpy


      If that doesn't work, then you have other issues.






      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%2f748929%2fno-module-named-numpy%23new-answer', 'question_page');
        }
        );

        Post as a guest















        Required, but never shown

























        3 Answers
        3






        active

        oldest

        votes








        3 Answers
        3






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        8














        You need to install numpy using pip

        install pip :



        sudo apt-get install python-pip python3-pip


        Then install numpy using pip



        sudo pip3 install -U numpy





        share|improve this answer






























          8














          You need to install numpy using pip

          install pip :



          sudo apt-get install python-pip python3-pip


          Then install numpy using pip



          sudo pip3 install -U numpy





          share|improve this answer




























            8












            8








            8







            You need to install numpy using pip

            install pip :



            sudo apt-get install python-pip python3-pip


            Then install numpy using pip



            sudo pip3 install -U numpy





            share|improve this answer















            You need to install numpy using pip

            install pip :



            sudo apt-get install python-pip python3-pip


            Then install numpy using pip



            sudo pip3 install -U numpy






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Mar 22 '16 at 17:39









            mchid

            23.4k25286




            23.4k25286










            answered Mar 22 '16 at 11:42









            Nadimul De CjNadimul De Cj

            20415




            20415

























                2














                Are you sure that you run python3 and not just python, which defaults to python2.7 on most systems.



                You can get the Version of python with



                python --version


                or



                python3 --version





                share|improve this answer




























                  2














                  Are you sure that you run python3 and not just python, which defaults to python2.7 on most systems.



                  You can get the Version of python with



                  python --version


                  or



                  python3 --version





                  share|improve this answer


























                    2












                    2








                    2







                    Are you sure that you run python3 and not just python, which defaults to python2.7 on most systems.



                    You can get the Version of python with



                    python --version


                    or



                    python3 --version





                    share|improve this answer













                    Are you sure that you run python3 and not just python, which defaults to python2.7 on most systems.



                    You can get the Version of python with



                    python --version


                    or



                    python3 --version






                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Mar 22 '16 at 20:28









                    Jim KnopfJim Knopf

                    412




                    412























                        0














                        If the other answer didn't work for you, try:



                        sudo apt-get update; sudo apt-get install python-pip python3-pip
                        sudo pip install numpy; sudo pip3 install numpy


                        If that doesn't work, then you have other issues.






                        share|improve this answer






























                          0














                          If the other answer didn't work for you, try:



                          sudo apt-get update; sudo apt-get install python-pip python3-pip
                          sudo pip install numpy; sudo pip3 install numpy


                          If that doesn't work, then you have other issues.






                          share|improve this answer




























                            0












                            0








                            0







                            If the other answer didn't work for you, try:



                            sudo apt-get update; sudo apt-get install python-pip python3-pip
                            sudo pip install numpy; sudo pip3 install numpy


                            If that doesn't work, then you have other issues.






                            share|improve this answer















                            If the other answer didn't work for you, try:



                            sudo apt-get update; sudo apt-get install python-pip python3-pip
                            sudo pip install numpy; sudo pip3 install numpy


                            If that doesn't work, then you have other issues.







                            share|improve this answer














                            share|improve this answer



                            share|improve this answer








                            edited Mar 22 '16 at 17:38









                            mchid

                            23.4k25286




                            23.4k25286










                            answered Mar 22 '16 at 17:29









                            catcat

                            9281338




                            9281338






























                                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%2f748929%2fno-module-named-numpy%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

                                How did Captain America manage to do this?

                                迪纳利

                                南乌拉尔铁路局