1

I would like to ask you if it's normal that my "Setting environment" changes after each system reboot or even if I just close my cmd console.

for example, I'm using python 3.5, when I wan to use python or to uses pip under the cmd I got an error like :

C:\>python 'python' is not recognized as an internal or external command, operable program or batch file. 

To fix this, I use :

set PATH=%PATH%;C:\Python35 

It works after, but as I said before, once I restart my computer, or I close the console, I've the same problem !!!

Thanks in advance for your help and comments. I just would like to inform you that I'm using Windows 7 - 64bits.

2 Answers 2

1

You need to add this path in System (Windows+Pause key), Advanced, Environment variables. There you have two sections, System and User, in System, edit the PATH key. The next time you start a console the path will be present.

Alternaly, if you don't want to modify the setting there (or you have no rights) you could start the app with a batch file which sets the path before launching the app.

In Ruby you can adapt the environment variables from within the script itself by using ENV eg ENV['path'] += 'C:\\Python35' , I'm sure Python can do this too but wouldn't know how. In your use case this won't help of course.

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

2 Comments

Thank you so much for your answer, actually I completely forget to add the path to the system section.
It's something the python installer should take care of, at least in a MS Windows philosophy. You are welcome
0

The SETX command will set the variable permanently. Use SETX /? for information. Set a persistent environment variable from cmd.exe

For Python, many developers use venv which is included with the Python install. https://docs.python.org/3/library/venv.html?highlight=venv#module-venv

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.