Python 在 OS X 上安装 pip
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/36372140/
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
Install pip on OS X
提问by Francisco José Rivera Pantoja
I want to install pip on OS X So I downloaded and install Python 3.4, and afterwards, Install pip by using the script provided by the Python Packaging Authority; but when I run pip I got a command not found
我想在 OS X 上安装 pip 所以我下载并安装了 Python 3.4,然后,使用 Python Packaging Authority 提供的脚本安装 pip;但是当我运行 pip 时,我找不到命令
MacBook-Pro-de-paquirrin:Home paquirrin$ sudo curl -O https://bootstrap.pypa.io/get-pip.py
Password:
Sorry, try again.
Password:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1487k 100 1487k 0 0 783k 0 0:00:01 0:00:01 --:--:-- 783k
MacBook-Pro-de-paquirrin:Home paquirrin$ sudo python3 get-pip.py
The directory '/Users/paquirrin/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/paquirrin/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting pip
Downloading pip-8.1.1-py2.py3-none-any.whl (1.2MB)
100% |████████████████████████████████| 1.2MB 718kB/s
Collecting wheel
Downloading wheel-0.29.0-py2.py3-none-any.whl (66kB)
100% |████████████████████████████████| 71kB 1.6MB/s
Installing collected packages: pip, wheel
Found existing installation: pip 6.0.8
Uninstalling pip-6.0.8:
Successfully uninstalled pip-6.0.8
Successfully installed pip-8.1.1 wheel-0.29.0
MacBook-Pro-de-paquirrin:Home paquirrin$ sudo pip install awsebcli
sudo: pip: command not found
采纳答案by ansi_lumen
Dunno, but this crossbar installation tutorialseems to cover your topic completely.
不知道,但是这个横杆安装教程似乎完全涵盖了您的主题。
Plus:You install your pip
locally. Try bin/pip
from within the folder you did the curl
command.
另外:您在pip
本地安装。bin/pip
从您执行curl
命令的文件夹中尝试。
回答by Siddharth Wagle
Easiest way i found was using home-brew, it install all basic python and pip too. But feel free to use macports too.
我发现最简单的方法是使用 home-brew,它也安装了所有基本的 python 和 pip。但是也可以随意使用 macports。
brew install python
I used the answers from the post, if you need more help: How do I install pip on macOS or OS X?
如果您需要更多帮助,我使用了帖子中的答案:如何在 macOS 或 OS X 上安装 pip?