IPython command not found Terminal OSX. Pip instal

2019-04-04 01:25发布

问题:

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!

回答1:

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



回答2:

Check IPython whether is installed by below command:

$python -m IPython

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:

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:

Try run brew install ipython:

then run xcode-select --install

run brew install git,

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

At last, run brew install ipython