[英]IPython command not found Terminal OSX. Pip installed
Using Python 2.7 installed via homebrew.使用通过自制软件安装的 Python 2.7。 I then used pip to install IPython.
然后我使用 pip 来安装 IPython。 So, IPython seems to be installed under:
因此,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?我不明白为什么这只会发生在 IPython 而不是 Python? Also, how do I fix this?
另外,我该如何解决这个问题? What path should I add in .bashrc?
我应该在 .bashrc 中添加什么路径? And how should I add?
我应该如何添加?
Currently, my .bashrc reads:目前,我的 .bashrc 显示:
PATH=$PATH:/usr/local/bin/ PATH=$PATH:/usr/local/bin/
Thanks!谢谢!
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
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_profile file然后在终端上运行此命令并添加到~/.bash_profile文件中
$alias ipython='python -m IPython'
So try run "ipython" again on terminal.所以尝试在终端上再次运行“ipython”。 It works fine for me.
这对我来说可以。
Reference topics:参考题目:
ipython on MacOS 10.10 - command not found MacOS 10.10 上的 ipython - 找不到命令
Create .pydistutils.cfg
in your homedir with following content:使用以下内容在您的
.pydistutils.cfg
中创建.pydistutils.cfg
:
[global]
verbose=1
[install]
install-scripts=$HOME/bin
[easy_install]
install-scripts=$HOME/bin
And then: pip install -U --user ipython
.然后:
pip install -U --user ipython
。 Of course $HOME/bin
must be in your $PATH
.当然
$HOME/bin
必须在你的$PATH
。 Packages are going to be installed in $HOME/Library/Python
, so user only, not system wide.软件包将安装在
$HOME/Library/Python
,因此仅限用户,而不是系统范围内。
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
I use pip3 install ipython
is OK.我用
pip3 install ipython
是可以的。
maybe ipython
rely on python3
也许
ipython
依赖于python3
After trying to a number of solutions like above with out joy, when I restarted my terminal, Ipython command launched.在尝试了上述多种解决方案后,当我重新启动终端时,启动了 Ipython 命令。 Don't forgot to restart your terminal after all the fiddling!
在所有摆弄之后不要忘记重新启动终端!
PS I think the brew install Ipython
did it ... but can't be sure. PS 我认为
brew install Ipython
做到了......但不能确定。
For me the only thing that helped was: python -m pip install --upgrade pip
对我来说唯一有帮助的是:
python -m pip install --upgrade pip
Upgrading pip did the work and all the installations started working properly!升级 pip 完成了工作,所有安装都开始正常工作! Give it a try.
试试看。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.