如何在没有sudo的情况下运行pip(适用于Mac)?没有sudo就无法工作 [英] How can I run pip without a sudo (for mac)? It doesnt work without sudo
本文介绍了如何在没有sudo的情况下运行pip(适用于Mac)?没有sudo就无法工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试安装python和pip.当我尝试安装pip时,它说它已经存在了, 运行以下命令,
I am trying to install python and pip. When I try to install pip, it says that it's already present, running the below command,
python get-pip.py
Requirement already up-to-date: pip in /Library/Python/2.7/site-packages/pip-1.5.6- py2.7.egg
但是当我尝试pip命令时,它说
But when I try the pip command, it says
user1$ pip
-bash: pip: command not found
我该如何解决?
推荐答案
如果这是一个sudo问题,您将不会得到找不到命令"的信息.尝试使用别名:
If it was a sudo issue, you wouldn't be getting "command not found". Try an alias instead:
cd ~
vim .bashrc
(如果没有vim,则为等效文本编辑器)
vim .bashrc
(or equivalent text editor if you don't have vim)
alias pip="path to pip"
(显然,您需要输入实际路径)
alias pip="path to pip"
(obviously you'll want to put in the actual path)
这篇关于如何在没有sudo的情况下运行pip(适用于Mac)?没有sudo就无法工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文