0

I have recently installed another Python without deleting previous and now when I am trying to run my script from cmd, Windows pushing me to choose the app that will run py.script.

jonrsharpe
  • 99,167
  • 19
  • 183
  • 334
  • 2
    You have to set the PATH variable to point to the right python executable. – alex067 Feb 19 '20 at 22:32
  • 1
    Some more information might aid to properly help you. Like how exactly are you running and what error exactly you are getting, to start with – Tomerikoo Feb 19 '20 at 22:34
  • actually i don't have any erorrs but when i turn on cmd and write the path of my folder with scripts, then i typing name.py and windows push me to choose aplication that will run th script – heylovemetoo Feb 19 '20 at 22:54
  • https://i.imgur.com/x75Y792.png https://i.imgur.com/qv3XJrM.png – heylovemetoo Feb 19 '20 at 22:55
  • @Tomerikoo hey, i just there pinned some photos with the problem process, will be very appreciate if you could help – heylovemetoo Feb 19 '20 at 23:14
  • 1
    the path is correct by the way – heylovemetoo Feb 19 '20 at 23:14
  • You should [edit] all that information, and any more you have, inside the question, not in comments. It will help other people coming here to get a clear view of your problem. Also try to avoid posting images or links to them. Whatever can be represented as text is better copied to the post as formatted text – Tomerikoo Feb 19 '20 at 23:17
  • if you want to run a script by calling it directly you should have the first line saying `#!usr/bin/python`. Otherwise you need to run it like `python name.py` https://stackoverflow.com/questions/2429511/why-do-people-write-the-usr-bin-env-python-shebang-on-the-first-line-of-a-pyt – Tomerikoo Feb 19 '20 at 23:20

1 Answers1

0

as alex067 stated, you have to set the PATH variable in your Environment Variables.

You can follow the instructions here https://superuser.com/questions/143119/how-do-i-add-python-to-the-windows-path

jdavid05
  • 235
  • 4
  • 12