问题
I have installed MySQL through the MySQL installer. but after that, my cmd didn't recognize python, pip, and ipython anymore. whereas I did not change anything, just installed MySQL. before that, everything was working correctly.
I expected to run python like always. but cmd shows me this : 'python' is not recognized as an internal or external command
回答1:
I think you need to add Python to your local variables. It seems MySQL deletes it.
Start the Run box and enter sysdm.cpl
Go to the Advanced tab in System Properties and click the Environment Variables button:
In the System variable window, find the Path variable and click Edit:
Position your cursor at the end of the Variable value line and add the path to the python.exe file, preceded with the semicolon character (;). In our example, we have added the value
;C:\Python34
.
You must change the C:\Python34 if you installed Python in another directory
回答2:
This may happen because your environmental variables are overwritten by some other application/program.
- Click on the Start button
- Search for "Environmental Variable" and click on first option.
- You will a window like this: https://i.stack.imgur.com/xyneH.png
- Click on the Environment Variables... button.
- Now you will get this window: https://i.stack.imgur.com/W4Mpj.png
- In the above window, double click on "path" highlighted at the bottom.
- Now you will get this window: https://i.stack.imgur.com/BQOgT.png
- Here check either the location of your Python directory is mentioned or not.
- If it is not added, then click on the New button and add the path of your directory (path where the .exe file is located)
来源:https://stackoverflow.com/questions/57776673/windows-cmd-doesnt-recognize-python-or-pip-after-installing-mysql