IPython command not found Terminal OSX. Pip instal

2019-04-04 01:22发布

Using Python 2.7 installed via homebrew. I then used pip to install IPython. So, IPython seems to be installed under:

/usr/local/lib/python2.7/site-packages/

I think this is true because there is a IPython directory and ipython egg.

However, when I type ipython in the terminal I get:

-bash: ipython: command not found

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?

Currently, my .bashrc reads:

PATH=$PATH:/usr/local/bin/

Thanks!

4条回答
Ridiculous、
2楼-- · 2019-04-04 01:30

Check IPython whether is installed by below command:

$python -m IPython

enter image description here If you got this result as above picture.

Then run this command on terminal and add into ~/.bash_profile file

$alias ipython='python -m IPython'

So try run "ipython" again on terminal. It works fine for me.

Reference topics:

ipython on MacOS 10.10 - command not found

iPython installed but not found

查看更多
男人必须洒脱
3楼-- · 2019-04-04 01:31

Create .pydistutils.cfg in your homedir with following content:

[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.

查看更多
够拽才男人
4楼-- · 2019-04-04 01:46

I had this issue too, the following worked for me and seems like a clean simple solution:

pip uninstall ipython

pip install ipython

I'm running mavericks and latest pip

查看更多
爷、活的狠高调
5楼-- · 2019-04-04 01:48

Try run brew install ipython:

enter image description here

then run xcode-select --install

run brew install git,

enter image description here

If you got this result as above picture. Refer to enter link description here

At last, run brew install ipython

查看更多
登录 后发表回答