2

I have installed Anaconda on my Windows 10 to install Python 3.6.

I now want to run some Python scripts like test.py.

As far as I understood, I need to initialize some system variables, but I am not really able to get the whole meaning. I can set system variables by typing sysdm.cpl at the start button. Is this the right way? Otherwise?

1
  • anaconda should set most of the env variables to get the python setup up and running. but, sysdm.cpl can be used to set additional system/env variables in windows. Commented Jul 26, 2017 at 11:58

2 Answers 2

3

If you want to set env variables permanently, then yes, this is the right way (start->sysdm.cpl->advanced->Environment variables)

If you want to set some variables for just one particular session, then open cmd.exe and set variables like

set _variable_=_value_

and then run your script.

Sign up to request clarification or add additional context in comments.

Comments

1

enter image description here 1- open cmd

2-use cd to go to the file where your script is located(cd.. to go to previous folder and cd name to go to another folder)

3-when you get there in cmd type

4-python filename.py

if you are using anaconda instead of cmd use anaconda prompt


adding python to path:

1-open windows explorer

2-on the left side left click this pc and choose properties

3-then go to advanced system settings

4-then at the bottom enviorment variables

5-if you are windows 10 there will be onedrive written at top and behind it path choose path

6-then click new

7-add python directory to the path and then python directory/scripts

https://www.youtube.com/watch?v=Y2q_b4ugPWk check this

11 Comments

This is simply not true :)
why?? i use this way
I had already tried this way, and python is not recognized as a command nor program nor a batch file.
than python is not in your path
you are using python 3 or 2?
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.