Not sure how to fix this Cmd command error?

瘦欲@ 提交于 2019-12-24 13:11:19

问题


Im on windows 8 and i have installed the latest python,and im going to use sublime text 3 as my ide to create a website using flask.But firstly i needed to install a virtual enviroment using this command pip install virtualenv,and this is the response i recived by cmd.

C:\Users\osman_000>pip install virtualenv
'pip' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\osman_000>

Please can someone help if you know how to fix this,as im not excatly sure what do from here thanks.


回答1:


Under Windows, pip is stored in the Python scripts folder, e.g. "C:\Python27\Scripts".

How to run pip?

  • Open a Command line by pressing [WIN]+R and typing cmd.exe.

  • Then navigate tho the Scrips folder of your Python installation by typing cd "C:\Python27\Scripts" (Or where else you've installed Python) into the command line.

  • To run pip now type pip.exe into the command line. This should print a help message.

  • If so, you can use pip install package_name to install a Python package.

What I recommend:

Navigating to the Scripts folder every time is very annoying, so you can tell Windows where your pip.exe is stored.

  • Open the control panel, search for "environment variables" and choose edit environment variables.

  • When a little window is opened, press the button "Environment variables" on the bottom.

  • Now, double-click the entry "Path", click "New" and enter "C:\Python27\Scripts" (If this is your intallation path, see above). Close all windows with clicking "OK", you're done!

  • Now opening a commandline and installing through pip should work.

Hope this helps!



来源:https://stackoverflow.com/questions/35919876/not-sure-how-to-fix-this-cmd-command-error

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