bash 找不到 IPython 命令终端 OSX。安装了点子
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16745923/
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
IPython command not found Terminal OSX. Pip installed
提问by Rohit
Using Python 2.7 installed via homebrew. I then used pip to install IPython. So, IPython seems to be installed under:
使用通过自制软件安装的 Python 2.7。然后我使用 pip 来安装 IPython。因此,IPython 似乎安装在:
/usr/local/lib/python2.7/site-packages/
/usr/local/lib/python2.7/site-packages/
I think this is true because there is a IPython directory and ipython egg.
我认为这是真的,因为有一个 IPython 目录和 ipython egg。
However, when I type ipython in the terminal I get:
但是,当我在终端中输入 ipython 时,我得到:
-bash: ipython: command not found
-bash: ipython: 命令未找到
I do not understand why this ONLY happens with IPython and not with python? Also, how do I fix this? What path should I add in .bashrc? And how should I add?
我不明白为什么这只会发生在 IPython 而不是 Python?另外,我该如何解决这个问题?我应该在 .bashrc 中添加什么路径?我应该如何添加?
Currently, my .bashrc reads:
目前,我的 .bashrc 显示:
PATH=$PATH:/usr/local/bin/
PATH=$PATH:/usr/local/bin/
Thanks!
谢谢!
回答by Robert
I had this issue too, the following worked for me and seems like a clean simple solution:
我也有这个问题,以下对我有用,似乎是一个干净简单的解决方案:
pip uninstall ipython
pip 卸载 ipython
pip install ipython
pip 安装 ipython
I'm running mavericks and latest pip
我正在运行小牛和最新的 pip
回答by Luna Kong
Check IPython whether is installed by below command:
通过以下命令检查 IPython 是否安装:
$python -m IPython
If you got this result as above picture.
Then run this command on terminal and add into ~/.bash_profilefile
然后在终端上运行此命令并添加到~/.bash_profile文件中
$alias ipython='python -m IPython'
So try run "ipython" again on terminal. It works fine for me.
所以尝试在终端上再次运行“ipython”。这对我来说可以。
Reference topics:
参考题目:
ipython on MacOS 10.10 - command not found
MacOS 10.10 上的 ipython - 找不到命令
回答by nudzo
Create .pydistutils.cfg
in your homedir with following content:
.pydistutils.cfg
使用以下内容在您的主目录中创建:
[global]
verbose=1
[install]
install-scripts=$HOME/bin
[easy_install]
install-scripts=$HOME/bin
And then: pip install -U --user ipython
. Of course $HOME/bin
must be in your $PATH
. Packages are going to be installed in $HOME/Library/Python
, so user only, not system wide.
然后:pip install -U --user ipython
。当然$HOME/bin
必须在你的$PATH
. 软件包将安装在$HOME/Library/Python
,因此仅限用户,而不是系统范围内。
回答by excited-tiger
Try run brew install ipython
:
尝试运行brew install ipython
:
then run xcode-select --install
;
然后运行xcode-select --install
;
run brew install git
,
运行brew install git
,
If you got this result as above picture. Refer to enter link description here
如果你得到如上图所示的结果。请参阅在此处输入链接描述
At last, run brew install ipython
最后,运行 brew install ipython
回答by anddju
I use pip3 install ipython
is OK.
我用的pip3 install ipython
还行。
maybe ipython
rely on python3
也许ipython
依靠python3
回答by Frank Ferdinand McGovern
After trying to a number of solutions like above with out joy, when I restarted my terminal, Ipython command launched. Don't forgot to restart your terminal after all the fiddling!
在尝试了上述多种解决方案后,当我重新启动终端时,启动了 Ipython 命令。在所有摆弄之后,不要忘记重新启动您的终端!
P.S. I think the brew install Ipython
did it ... but can't be sure.
PS我认为brew install Ipython
做到了......但不能确定。