bash: pip: 找不到命令 [英] bash: pip: command not found

查看:149
本文介绍了bash: pip: 找不到命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我下载了 pip 并运行了 python setup.py install 一切正常.本教程的下一步是运行 pip install <lib you want> 但在它尝试在线查找任何内容之前,我收到一个错误bash: pip: command not found".>

这是在 Mac OS X 上,我也是新手,所以我假设在我运行 setup.py 时有某种路径设置没有正确设置.我该如何进一步调查?我需要检查什么才能更好地了解问题的确切原因?

我还尝试为 Mac 安装 Python 2.7,希望友好的安装过程可以进行任何内务处理,例如编辑 PATH 以及其他任何需要让一切按照教程正常工作的东西,但这没有用.安装后运行 'python' 仍然运行 Python 2.6 并且 PATH 未更新.

解决方案

为什么不直接使用 sudo easy_install pip 或者如果这是针对 python 2.6 sudo easy_install-2.6 pip?

这将使用默认的 python 包安装程序系统安装 pip,同时为您省去手动设置的麻烦.

这将允许您然后运行 ​​pip 命令来安装 python 包,因为它将与系统 python 一起安装.我还建议您使用 virtualenv 包和模式获得 pip.:)

I downloaded pip and ran python setup.py install and everything worked just fine. The very next step in the tutorial is to run pip install <lib you want> but before it even tries to find anything online I get an error "bash: pip: command not found".

This is on Mac OS X, which I'm new too, so I'm assuming there's some kind of path setting that was not set correctly when I ran setup.py. How can I investigate further? What do I need to check to get a better idea of the exact cause of the problem?

EDIT: I also tried installing Python 2.7 for Mac in the hopes that the friendly install process would do any housekeeping like editing PATH and whatever else needs to happy for everything to work according to the tutorials, but this didn't work. After installing is running 'python' still ran Python 2.6 and PATH was not updated.

解决方案

Why not just do sudo easy_install pip or if this is for python 2.6 sudo easy_install-2.6 pip?

This installs pip using the default python package installer system and saves you the hassle of manual set-up all at the same time.

This will allow you to then run the pip command for python package installation as it will be installed with the system python. I also recommend once you have pip using the virtualenv package and pattern. :)

这篇关于bash: pip: 找不到命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆