Python 找不到 Pip 命令。路径问题

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/52470651/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 20:07:32  来源:igfitidea点击:

Pip command not found. Issues with Path

pythonpip

提问by user10405291

I am new to python and terminal so I apologize in advance and thank you for your time. I installed python as well as homebrew. I was trying to do

我是 python 和终端的新手,所以我提前道歉并感谢您的时间。我安装了python和自制软件。我试图做

$ sudo easy_install pip

and received

并收到

Password:
Searching for pip
Reading https://pypi.python.org/simple/pip/
Download error on https://pypi.python.org/simple/pip/: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) -- Some packages may not be found!
Couldn't find index page for 'pip' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.python.org/simple/
Download error on https://pypi.python.org/simple/: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) -- Some packages may not be found!
No local packages or download links found for pip
error: Could not find suitable distribution for Requirement.parse('pip')

I have spent most of the day looking up answers to fixing this issue but I feel as though I am just muddying up my directories. I am at a point where it might be better to just erase/uninstall anything python related and reinstall correctly.

我花了一天的大部分时间寻找解决这个问题的答案,但我觉得我只是在混淆我的目录。我现在最好擦除/卸载任何与 python 相关的东西并正确重新安装。

when I look up the path there are many different versions of python in different directories

当我查找路径时,不同目录中有许多不同版本的python

~$ echo $PATH   /Library/Frameworks/Python.framework/Versions/3.7/bin:/Library/Frameworks/Python.framework/Versions/3.4/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin

Any advice on how to fix this issue/troubleshoot would be greatly appreciated. Or a way to recursively uninstall/erase python so that I can start fresh if this would be easier. Thank You

任何有关如何解决此问题/故障排除的建议将不胜感激。或者一种递归卸载/擦除python的方法,这样我就可以重新开始,如果这会更容易的话。谢谢你

回答by Kanke

On xcode8.3 you need to use either pip2or pip3so for example; pip3 install flask

在xcode8.3你需要为使用pip2pip3因此,例如;pip3 install flask

回答by Chethan G B

Use below commands:

使用以下命令:

python -m ensurepip
python -m pip install apache-airflow