3

trying to install spark, I've some problems when I try to set the system enviroment variables. I modify the PATH using:

“Advanced system settings” → “Environment Variables”

but when I call these variables from python, using the code:

import os path = os.environ.get('PATH', None) print(path) 

The path that shows python don't have the modifications that I put. Thanks

1
  • Did you add your new path to the "Path" variable from system variables or user variables? Commented Aug 1, 2016 at 12:36

1 Answer 1

5

Any program invoked from the command prompt will be given the environment variables that was at the time the command prompt was invoked.

Therefore, when you modify or add an environment variable you should restart the command prompt (cmd.exe) and then invoke python to see the changes.

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.