Windows cmd doesn't recognize python or pip after installing mysql

a 夏天 提交于 2020-06-16 05:45:47

问题


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.

  1. Start the Run box and enter sysdm.cpl

  2. Go to the Advanced tab in System Properties and click the Environment Variables button:

  3. In the System variable window, find the Path variable and click Edit:

  4. 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.

    Enter image description here

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.

  1. Click on the Start button
  2. Search for "Environmental Variable" and click on first option.
  3. You will a window like this: https://i.stack.imgur.com/xyneH.png
  4. Click on the Environment Variables... button.
  5. Now you will get this window: https://i.stack.imgur.com/W4Mpj.png
  6. In the above window, double click on "path" highlighted at the bottom.
  7. Now you will get this window: https://i.stack.imgur.com/BQOgT.png
  8. Here check either the location of your Python directory is mentioned or not.
  9. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!