How to use python using anaconda? [duplicate]












2
















This question already has an answer here:




  • Git Bash won't run my python files?

    6 answers



  • Conda not recognized as internal or external after creating new environment

    1 answer




I installed anaconda for python 3.7 in my windows 10 pc.



When I put python in gitBash, it says



bash: python: command not found



How can I use python globally? So I can use python command everywhere.










share|improve this question













marked as duplicate by U9-Forward, Community Jan 1 at 11:21


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.



















  • Did you check Add to PATH option while installing it? If not then you will need to manually add the PATH.

    – hygull
    Jan 1 at 6:14













  • I can not remember. Can I check it somehow now?

    – Shams Nahid
    Jan 1 at 6:15











  • Check my answer at stackoverflow.com/questions/49142567/… and set PATH then try again, check my answer as well for few more steps. I have added picture for Windows 10, it will help you.

    – hygull
    Jan 1 at 6:27


















2
















This question already has an answer here:




  • Git Bash won't run my python files?

    6 answers



  • Conda not recognized as internal or external after creating new environment

    1 answer




I installed anaconda for python 3.7 in my windows 10 pc.



When I put python in gitBash, it says



bash: python: command not found



How can I use python globally? So I can use python command everywhere.










share|improve this question













marked as duplicate by U9-Forward, Community Jan 1 at 11:21


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.



















  • Did you check Add to PATH option while installing it? If not then you will need to manually add the PATH.

    – hygull
    Jan 1 at 6:14













  • I can not remember. Can I check it somehow now?

    – Shams Nahid
    Jan 1 at 6:15











  • Check my answer at stackoverflow.com/questions/49142567/… and set PATH then try again, check my answer as well for few more steps. I have added picture for Windows 10, it will help you.

    – hygull
    Jan 1 at 6:27
















2












2








2


1







This question already has an answer here:




  • Git Bash won't run my python files?

    6 answers



  • Conda not recognized as internal or external after creating new environment

    1 answer




I installed anaconda for python 3.7 in my windows 10 pc.



When I put python in gitBash, it says



bash: python: command not found



How can I use python globally? So I can use python command everywhere.










share|improve this question















This question already has an answer here:




  • Git Bash won't run my python files?

    6 answers



  • Conda not recognized as internal or external after creating new environment

    1 answer




I installed anaconda for python 3.7 in my windows 10 pc.



When I put python in gitBash, it says



bash: python: command not found



How can I use python globally? So I can use python command everywhere.





This question already has an answer here:




  • Git Bash won't run my python files?

    6 answers



  • Conda not recognized as internal or external after creating new environment

    1 answer








python anaconda






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 1 at 6:12









Shams NahidShams Nahid

1,23551325




1,23551325




marked as duplicate by U9-Forward, Community Jan 1 at 11:21


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 U9-Forward, Community Jan 1 at 11:21


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.















  • Did you check Add to PATH option while installing it? If not then you will need to manually add the PATH.

    – hygull
    Jan 1 at 6:14













  • I can not remember. Can I check it somehow now?

    – Shams Nahid
    Jan 1 at 6:15











  • Check my answer at stackoverflow.com/questions/49142567/… and set PATH then try again, check my answer as well for few more steps. I have added picture for Windows 10, it will help you.

    – hygull
    Jan 1 at 6:27





















  • Did you check Add to PATH option while installing it? If not then you will need to manually add the PATH.

    – hygull
    Jan 1 at 6:14













  • I can not remember. Can I check it somehow now?

    – Shams Nahid
    Jan 1 at 6:15











  • Check my answer at stackoverflow.com/questions/49142567/… and set PATH then try again, check my answer as well for few more steps. I have added picture for Windows 10, it will help you.

    – hygull
    Jan 1 at 6:27



















Did you check Add to PATH option while installing it? If not then you will need to manually add the PATH.

– hygull
Jan 1 at 6:14







Did you check Add to PATH option while installing it? If not then you will need to manually add the PATH.

– hygull
Jan 1 at 6:14















I can not remember. Can I check it somehow now?

– Shams Nahid
Jan 1 at 6:15





I can not remember. Can I check it somehow now?

– Shams Nahid
Jan 1 at 6:15













Check my answer at stackoverflow.com/questions/49142567/… and set PATH then try again, check my answer as well for few more steps. I have added picture for Windows 10, it will help you.

– hygull
Jan 1 at 6:27







Check my answer at stackoverflow.com/questions/49142567/… and set PATH then try again, check my answer as well for few more steps. I have added picture for Windows 10, it will help you.

– hygull
Jan 1 at 6:27














4 Answers
4






active

oldest

votes


















1














you should execute "Anaconda Prompt" and then you can start "python" from there.



it is not recommended to "add to path" during Anaconda installation on Windows 10. So, it's normal python from Anaconda is not in your path.






share|improve this answer
























  • Now I can use python from Anaconda Prompt. But how can I use it in gitBash or vs code integrated terminal? Is it a bad practice?

    – Shams Nahid
    Jan 1 at 6:20











  • @ShamsNahid you can check code.visualstudio.com/docs/python/environments

    – Windchill
    Jan 1 at 6:21











  • by default, you have "base" already and you can create new virtualenv too.

    – Windchill
    Jan 1 at 6:22











  • I usually use pyCharm but I just have had a quick check on VS code on my Mac and windows 10, it works as expected. please let me know if you still have questions.

    – Windchill
    Jan 1 at 6:26



















0














Add python to your path like this:



$ PATH=$PATH:/path/to/python


and do not specify the .exe then you can use it from git bash






share|improve this answer































    0














    @Nahid, you can check my answer at Conda not recognized as internal or external after creating new environment.




    • Close already opened terminals.


    • Follow the instructions given in that link.


    • Open new terminal (Git BASH).


    • Type winpty python or python -i (Simply typing python on terminal will not work).



    Enjoy and ask/comment here if you face any issue.






    share|improve this answer

































      0














      It depends where you installed Anaconda. Unless you have install Linux version of Anaconda(preferable Miniconda), you need to point gitBash to your Windows Python. E.g. in gitBash



      alias python='winpty python.exe'


      If you want a specific Python the 'winpty fullpath/python.exe' to make it permanent, add that command to your .bashrc



      cd ~
      touch .bashrc


      Then add the command above. Save and restart your terminal.



      Similar issue: Python not working in the command line of git bash






      share|improve this answer






























        4 Answers
        4






        active

        oldest

        votes








        4 Answers
        4






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        1














        you should execute "Anaconda Prompt" and then you can start "python" from there.



        it is not recommended to "add to path" during Anaconda installation on Windows 10. So, it's normal python from Anaconda is not in your path.






        share|improve this answer
























        • Now I can use python from Anaconda Prompt. But how can I use it in gitBash or vs code integrated terminal? Is it a bad practice?

          – Shams Nahid
          Jan 1 at 6:20











        • @ShamsNahid you can check code.visualstudio.com/docs/python/environments

          – Windchill
          Jan 1 at 6:21











        • by default, you have "base" already and you can create new virtualenv too.

          – Windchill
          Jan 1 at 6:22











        • I usually use pyCharm but I just have had a quick check on VS code on my Mac and windows 10, it works as expected. please let me know if you still have questions.

          – Windchill
          Jan 1 at 6:26
















        1














        you should execute "Anaconda Prompt" and then you can start "python" from there.



        it is not recommended to "add to path" during Anaconda installation on Windows 10. So, it's normal python from Anaconda is not in your path.






        share|improve this answer
























        • Now I can use python from Anaconda Prompt. But how can I use it in gitBash or vs code integrated terminal? Is it a bad practice?

          – Shams Nahid
          Jan 1 at 6:20











        • @ShamsNahid you can check code.visualstudio.com/docs/python/environments

          – Windchill
          Jan 1 at 6:21











        • by default, you have "base" already and you can create new virtualenv too.

          – Windchill
          Jan 1 at 6:22











        • I usually use pyCharm but I just have had a quick check on VS code on my Mac and windows 10, it works as expected. please let me know if you still have questions.

          – Windchill
          Jan 1 at 6:26














        1












        1








        1







        you should execute "Anaconda Prompt" and then you can start "python" from there.



        it is not recommended to "add to path" during Anaconda installation on Windows 10. So, it's normal python from Anaconda is not in your path.






        share|improve this answer













        you should execute "Anaconda Prompt" and then you can start "python" from there.



        it is not recommended to "add to path" during Anaconda installation on Windows 10. So, it's normal python from Anaconda is not in your path.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 1 at 6:15









        WindchillWindchill

        690614




        690614













        • Now I can use python from Anaconda Prompt. But how can I use it in gitBash or vs code integrated terminal? Is it a bad practice?

          – Shams Nahid
          Jan 1 at 6:20











        • @ShamsNahid you can check code.visualstudio.com/docs/python/environments

          – Windchill
          Jan 1 at 6:21











        • by default, you have "base" already and you can create new virtualenv too.

          – Windchill
          Jan 1 at 6:22











        • I usually use pyCharm but I just have had a quick check on VS code on my Mac and windows 10, it works as expected. please let me know if you still have questions.

          – Windchill
          Jan 1 at 6:26



















        • Now I can use python from Anaconda Prompt. But how can I use it in gitBash or vs code integrated terminal? Is it a bad practice?

          – Shams Nahid
          Jan 1 at 6:20











        • @ShamsNahid you can check code.visualstudio.com/docs/python/environments

          – Windchill
          Jan 1 at 6:21











        • by default, you have "base" already and you can create new virtualenv too.

          – Windchill
          Jan 1 at 6:22











        • I usually use pyCharm but I just have had a quick check on VS code on my Mac and windows 10, it works as expected. please let me know if you still have questions.

          – Windchill
          Jan 1 at 6:26

















        Now I can use python from Anaconda Prompt. But how can I use it in gitBash or vs code integrated terminal? Is it a bad practice?

        – Shams Nahid
        Jan 1 at 6:20





        Now I can use python from Anaconda Prompt. But how can I use it in gitBash or vs code integrated terminal? Is it a bad practice?

        – Shams Nahid
        Jan 1 at 6:20













        @ShamsNahid you can check code.visualstudio.com/docs/python/environments

        – Windchill
        Jan 1 at 6:21





        @ShamsNahid you can check code.visualstudio.com/docs/python/environments

        – Windchill
        Jan 1 at 6:21













        by default, you have "base" already and you can create new virtualenv too.

        – Windchill
        Jan 1 at 6:22





        by default, you have "base" already and you can create new virtualenv too.

        – Windchill
        Jan 1 at 6:22













        I usually use pyCharm but I just have had a quick check on VS code on my Mac and windows 10, it works as expected. please let me know if you still have questions.

        – Windchill
        Jan 1 at 6:26





        I usually use pyCharm but I just have had a quick check on VS code on my Mac and windows 10, it works as expected. please let me know if you still have questions.

        – Windchill
        Jan 1 at 6:26













        0














        Add python to your path like this:



        $ PATH=$PATH:/path/to/python


        and do not specify the .exe then you can use it from git bash






        share|improve this answer




























          0














          Add python to your path like this:



          $ PATH=$PATH:/path/to/python


          and do not specify the .exe then you can use it from git bash






          share|improve this answer


























            0












            0








            0







            Add python to your path like this:



            $ PATH=$PATH:/path/to/python


            and do not specify the .exe then you can use it from git bash






            share|improve this answer













            Add python to your path like this:



            $ PATH=$PATH:/path/to/python


            and do not specify the .exe then you can use it from git bash







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Jan 1 at 6:16









            GlyphackGlyphack

            95311




            95311























                0














                @Nahid, you can check my answer at Conda not recognized as internal or external after creating new environment.




                • Close already opened terminals.


                • Follow the instructions given in that link.


                • Open new terminal (Git BASH).


                • Type winpty python or python -i (Simply typing python on terminal will not work).



                Enjoy and ask/comment here if you face any issue.






                share|improve this answer






























                  0














                  @Nahid, you can check my answer at Conda not recognized as internal or external after creating new environment.




                  • Close already opened terminals.


                  • Follow the instructions given in that link.


                  • Open new terminal (Git BASH).


                  • Type winpty python or python -i (Simply typing python on terminal will not work).



                  Enjoy and ask/comment here if you face any issue.






                  share|improve this answer




























                    0












                    0








                    0







                    @Nahid, you can check my answer at Conda not recognized as internal or external after creating new environment.




                    • Close already opened terminals.


                    • Follow the instructions given in that link.


                    • Open new terminal (Git BASH).


                    • Type winpty python or python -i (Simply typing python on terminal will not work).



                    Enjoy and ask/comment here if you face any issue.






                    share|improve this answer















                    @Nahid, you can check my answer at Conda not recognized as internal or external after creating new environment.




                    • Close already opened terminals.


                    • Follow the instructions given in that link.


                    • Open new terminal (Git BASH).


                    • Type winpty python or python -i (Simply typing python on terminal will not work).



                    Enjoy and ask/comment here if you face any issue.







                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited Jan 1 at 6:44

























                    answered Jan 1 at 6:23









                    hygullhygull

                    3,68021432




                    3,68021432























                        0














                        It depends where you installed Anaconda. Unless you have install Linux version of Anaconda(preferable Miniconda), you need to point gitBash to your Windows Python. E.g. in gitBash



                        alias python='winpty python.exe'


                        If you want a specific Python the 'winpty fullpath/python.exe' to make it permanent, add that command to your .bashrc



                        cd ~
                        touch .bashrc


                        Then add the command above. Save and restart your terminal.



                        Similar issue: Python not working in the command line of git bash






                        share|improve this answer




























                          0














                          It depends where you installed Anaconda. Unless you have install Linux version of Anaconda(preferable Miniconda), you need to point gitBash to your Windows Python. E.g. in gitBash



                          alias python='winpty python.exe'


                          If you want a specific Python the 'winpty fullpath/python.exe' to make it permanent, add that command to your .bashrc



                          cd ~
                          touch .bashrc


                          Then add the command above. Save and restart your terminal.



                          Similar issue: Python not working in the command line of git bash






                          share|improve this answer


























                            0












                            0








                            0







                            It depends where you installed Anaconda. Unless you have install Linux version of Anaconda(preferable Miniconda), you need to point gitBash to your Windows Python. E.g. in gitBash



                            alias python='winpty python.exe'


                            If you want a specific Python the 'winpty fullpath/python.exe' to make it permanent, add that command to your .bashrc



                            cd ~
                            touch .bashrc


                            Then add the command above. Save and restart your terminal.



                            Similar issue: Python not working in the command line of git bash






                            share|improve this answer













                            It depends where you installed Anaconda. Unless you have install Linux version of Anaconda(preferable Miniconda), you need to point gitBash to your Windows Python. E.g. in gitBash



                            alias python='winpty python.exe'


                            If you want a specific Python the 'winpty fullpath/python.exe' to make it permanent, add that command to your .bashrc



                            cd ~
                            touch .bashrc


                            Then add the command above. Save and restart your terminal.



                            Similar issue: Python not working in the command line of git bash







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Jan 1 at 6:44









                            Prayson W. DanielPrayson W. Daniel

                            2,08311319




                            2,08311319















                                Popular posts from this blog

                                Can a sorcerer learn a 5th-level spell early by creating spell slots using the Font of Magic feature?

                                Does disintegrating a polymorphed enemy still kill it after the 2018 errata?

                                A Topological Invariant for $pi_3(U(n))$