Pip is not recognizing the install command (Windows 7, Python 3.3) [duplicate]

半腔热情 提交于 2020-01-17 14:46:18

问题


I am trying to install Python programs using Pip. Python recognizes the pip module, but none of the pip commands. Has anyone else had this problem?

For example,


回答1:


pip is a command-line tool, that also happens to be a module you can import.

To install a package, execute the command-line tool, not the module. E.g. run pip in your terminal or console, not in Python itself:

$ pip install python-etsy

You tried to execute the command-line syntax in a Python shell; that's not valid Python syntax.

As of Python 3.4, pip is included with Python, but to ensure you get to use the right version, you need to use the Python py command to invoke it:

py -3 -m pip install python-etsy

See the Installing Python Modules documentation.




回答2:


To use 'pip' in windows you have to change the directory to the folder 'pip' is installed in and then execute it.

In Python 2.7 'pip' and 'easy_install' are in 'Python27\Scripts' as far as i remember 'pip' should be in 'Python3x\Lib\site-packages'. Just navigate your cmd to the right folder with the command 'cd'.

open cmd
type 'cd C:\Python3x\Lib\site-packages' with x replaced by your version.
type 'pip.exe install requests' or 'easy_install.exe requests'


来源:https://stackoverflow.com/questions/24069478/pip-is-not-recognizing-the-install-command-windows-7-python-3-3

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