Cant import module from python console unless entered via CMD [duplicate]










1
















This question already has an answer here:



  • Can't find the modules that have been installed by pip

    1 answer



I installed a module with command



pip install serial


And it appears to have been successful.



I can open up a cmd and enter python and then import serial without any issues.



However, if I open up either



  • Python 3.6 (64-bit)

  • Python 3.6 (32-bit)

  • IDLE (Python 3.6 64-bit)

  • IDLE (Python 3.6 32-bit)

And try the same command (import serial) I get an annoying




Traceback (most recent call last):



File "", line 1, in



ModuleNotFoundError: No module named 'serial'




What is going on here?










share|improve this question















marked as duplicate by Baum mit Augen, Community Nov 12 '18 at 14:22


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.















  • What does python --version show from cmd?

    – Mad Physicist
    Nov 12 '18 at 14:07











  • See if this helps you: stackoverflow.com/questions/33267070/no-module-named-serial. Not saying it is duplicate just if this solves your purpose

    – Rahul Agarwal
    Nov 12 '18 at 14:08











  • @MadPhysicist It says Python 2.7.15 - I guess my path is wrong?

    – Bassie
    Nov 12 '18 at 14:09















1
















This question already has an answer here:



  • Can't find the modules that have been installed by pip

    1 answer



I installed a module with command



pip install serial


And it appears to have been successful.



I can open up a cmd and enter python and then import serial without any issues.



However, if I open up either



  • Python 3.6 (64-bit)

  • Python 3.6 (32-bit)

  • IDLE (Python 3.6 64-bit)

  • IDLE (Python 3.6 32-bit)

And try the same command (import serial) I get an annoying




Traceback (most recent call last):



File "", line 1, in



ModuleNotFoundError: No module named 'serial'




What is going on here?










share|improve this question















marked as duplicate by Baum mit Augen, Community Nov 12 '18 at 14:22


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.















  • What does python --version show from cmd?

    – Mad Physicist
    Nov 12 '18 at 14:07











  • See if this helps you: stackoverflow.com/questions/33267070/no-module-named-serial. Not saying it is duplicate just if this solves your purpose

    – Rahul Agarwal
    Nov 12 '18 at 14:08











  • @MadPhysicist It says Python 2.7.15 - I guess my path is wrong?

    – Bassie
    Nov 12 '18 at 14:09













1












1








1









This question already has an answer here:



  • Can't find the modules that have been installed by pip

    1 answer



I installed a module with command



pip install serial


And it appears to have been successful.



I can open up a cmd and enter python and then import serial without any issues.



However, if I open up either



  • Python 3.6 (64-bit)

  • Python 3.6 (32-bit)

  • IDLE (Python 3.6 64-bit)

  • IDLE (Python 3.6 32-bit)

And try the same command (import serial) I get an annoying




Traceback (most recent call last):



File "", line 1, in



ModuleNotFoundError: No module named 'serial'




What is going on here?










share|improve this question

















This question already has an answer here:



  • Can't find the modules that have been installed by pip

    1 answer



I installed a module with command



pip install serial


And it appears to have been successful.



I can open up a cmd and enter python and then import serial without any issues.



However, if I open up either



  • Python 3.6 (64-bit)

  • Python 3.6 (32-bit)

  • IDLE (Python 3.6 64-bit)

  • IDLE (Python 3.6 32-bit)

And try the same command (import serial) I get an annoying




Traceback (most recent call last):



File "", line 1, in



ModuleNotFoundError: No module named 'serial'




What is going on here?





This question already has an answer here:



  • Can't find the modules that have been installed by pip

    1 answer







python python-3.x pip






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 12 '18 at 14:12









Mehrdad Pedramfar

4,96211237




4,96211237










asked Nov 12 '18 at 14:05









BassieBassie

3,7931946




3,7931946




marked as duplicate by Baum mit Augen, Community Nov 12 '18 at 14:22


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






marked as duplicate by Baum mit Augen, Community Nov 12 '18 at 14:22


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.














  • What does python --version show from cmd?

    – Mad Physicist
    Nov 12 '18 at 14:07











  • See if this helps you: stackoverflow.com/questions/33267070/no-module-named-serial. Not saying it is duplicate just if this solves your purpose

    – Rahul Agarwal
    Nov 12 '18 at 14:08











  • @MadPhysicist It says Python 2.7.15 - I guess my path is wrong?

    – Bassie
    Nov 12 '18 at 14:09

















  • What does python --version show from cmd?

    – Mad Physicist
    Nov 12 '18 at 14:07











  • See if this helps you: stackoverflow.com/questions/33267070/no-module-named-serial. Not saying it is duplicate just if this solves your purpose

    – Rahul Agarwal
    Nov 12 '18 at 14:08











  • @MadPhysicist It says Python 2.7.15 - I guess my path is wrong?

    – Bassie
    Nov 12 '18 at 14:09
















What does python --version show from cmd?

– Mad Physicist
Nov 12 '18 at 14:07





What does python --version show from cmd?

– Mad Physicist
Nov 12 '18 at 14:07













See if this helps you: stackoverflow.com/questions/33267070/no-module-named-serial. Not saying it is duplicate just if this solves your purpose

– Rahul Agarwal
Nov 12 '18 at 14:08





See if this helps you: stackoverflow.com/questions/33267070/no-module-named-serial. Not saying it is duplicate just if this solves your purpose

– Rahul Agarwal
Nov 12 '18 at 14:08













@MadPhysicist It says Python 2.7.15 - I guess my path is wrong?

– Bassie
Nov 12 '18 at 14:09





@MadPhysicist It says Python 2.7.15 - I guess my path is wrong?

– Bassie
Nov 12 '18 at 14:09












2 Answers
2






active

oldest

votes


















2














You should install it with python 3.6.
try these



pip3.6 install serial


or



python3.6 -m pip install serial





share|improve this answer


















  • 1





    pip3 may also work.

    – Blacksilver
    Nov 12 '18 at 14:16


















1














You probably have more then one Python shell on your PC.
According to your comment , you installed the module on python 2.7.15 and try to work with it in python 3.6.



  1. Install it on the same shell you will use it (using pip command is most convenient)

  2. Configure your IDE to use the correct python shell

Please note that if you use pip from the command line , without entering the python shell , you will not be able to know , on which shell it was installed.



In case you have multiple python shell , you need to enter the python shell and then use pip command.






share|improve this answer





























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2














    You should install it with python 3.6.
    try these



    pip3.6 install serial


    or



    python3.6 -m pip install serial





    share|improve this answer


















    • 1





      pip3 may also work.

      – Blacksilver
      Nov 12 '18 at 14:16















    2














    You should install it with python 3.6.
    try these



    pip3.6 install serial


    or



    python3.6 -m pip install serial





    share|improve this answer


















    • 1





      pip3 may also work.

      – Blacksilver
      Nov 12 '18 at 14:16













    2












    2








    2







    You should install it with python 3.6.
    try these



    pip3.6 install serial


    or



    python3.6 -m pip install serial





    share|improve this answer













    You should install it with python 3.6.
    try these



    pip3.6 install serial


    or



    python3.6 -m pip install serial






    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Nov 12 '18 at 14:08









    Mehrdad PedramfarMehrdad Pedramfar

    4,96211237




    4,96211237







    • 1





      pip3 may also work.

      – Blacksilver
      Nov 12 '18 at 14:16












    • 1





      pip3 may also work.

      – Blacksilver
      Nov 12 '18 at 14:16







    1




    1





    pip3 may also work.

    – Blacksilver
    Nov 12 '18 at 14:16





    pip3 may also work.

    – Blacksilver
    Nov 12 '18 at 14:16













    1














    You probably have more then one Python shell on your PC.
    According to your comment , you installed the module on python 2.7.15 and try to work with it in python 3.6.



    1. Install it on the same shell you will use it (using pip command is most convenient)

    2. Configure your IDE to use the correct python shell

    Please note that if you use pip from the command line , without entering the python shell , you will not be able to know , on which shell it was installed.



    In case you have multiple python shell , you need to enter the python shell and then use pip command.






    share|improve this answer



























      1














      You probably have more then one Python shell on your PC.
      According to your comment , you installed the module on python 2.7.15 and try to work with it in python 3.6.



      1. Install it on the same shell you will use it (using pip command is most convenient)

      2. Configure your IDE to use the correct python shell

      Please note that if you use pip from the command line , without entering the python shell , you will not be able to know , on which shell it was installed.



      In case you have multiple python shell , you need to enter the python shell and then use pip command.






      share|improve this answer

























        1












        1








        1







        You probably have more then one Python shell on your PC.
        According to your comment , you installed the module on python 2.7.15 and try to work with it in python 3.6.



        1. Install it on the same shell you will use it (using pip command is most convenient)

        2. Configure your IDE to use the correct python shell

        Please note that if you use pip from the command line , without entering the python shell , you will not be able to know , on which shell it was installed.



        In case you have multiple python shell , you need to enter the python shell and then use pip command.






        share|improve this answer













        You probably have more then one Python shell on your PC.
        According to your comment , you installed the module on python 2.7.15 and try to work with it in python 3.6.



        1. Install it on the same shell you will use it (using pip command is most convenient)

        2. Configure your IDE to use the correct python shell

        Please note that if you use pip from the command line , without entering the python shell , you will not be able to know , on which shell it was installed.



        In case you have multiple python shell , you need to enter the python shell and then use pip command.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 12 '18 at 14:20









        Gil.IGil.I

        624921




        624921













            Popular posts from this blog

            How to how show current date and time by default on contact form 7 in WordPress without taking input from user in datetimepicker

            Syphilis

            Darth Vader #20