IPython command not found Terminal OSX. Pip installed

33,659

Solution 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

Solution 2

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

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

Solution 4

I use pip3 install ipython is OK.

maybe ipython rely on python3

Solution 5

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

Share:
33,659
Rohit
Author by

Rohit

An Astrophysicist who's getting away from IRAF & IDL and into Python

Updated on January 08, 2021

Comments

  • Rohit
    Rohit over 3 years

    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!

  • Rohit
    Rohit almost 11 years
    Hmm....when I do the pip command as you suggested I get: no such option: --user #I added my account name as user, obviously! Any ideas why the command fails?
  • nudzo
    nudzo almost 11 years
    pip needs to be installed into homedir too. Run easy_install --user pip, to got one in your $HOME/bin and then --user option will be enabled.
  • Rohit
    Rohit almost 11 years
    Wait, when I try EXACTLY the command you suggested I have the following: pip install -U --user ipython Requirement already up-to-date: ipython in /usr/local/lib/python2.7/site-packages Cleaning up...
  • Rohit
    Rohit almost 11 years
    OK, I did the following: easy_install --user pip Searching for pip Best match: pip 1.3.1 Processing pip-1.3.1-py2.7.egg Adding pip 1.3.1 to easy-install.pth file Installing pip script to /Users/XXXX/bin Installing pip-2.7 script to /Users/XXXX/bin where XXXX is the username. I also have the .pydistutils.cfg file in my home directory and still ipython command is not recognized.
  • nudzo
    nudzo almost 11 years
    The run again: pip install -U --user --force ipython, to get it reinstalled and scripts put in $HOME/bin.
  • Rohit
    Rohit almost 11 years
    Yay! That works. Thanks SO MUCH for your patience and perseverance.
  • Rohit
    Rohit about 10 years
    Thanks for your answer. I just installed Anaconda and got everything to work.
  • Gravity M
    Gravity M over 9 years
    For some users, doing just pip install ipython might give an access denied error. In that case, you need: sudo pip install ipython
  • hlin117
    hlin117 about 8 years
    Using pip install -U --user --force ipython worked through.
  • tzaman
    tzaman almost 8 years
    Found this necessary again on El Capitan; thanks for the detailed instructions.
  • braulio
    braulio over 3 years
    just had similar issue when updating from Mac OSX Mojave to Catalina and changing to zsh as a standard shell, even in the bash version of it the ipython command was broken, adding alias ipython="python3 -m IPython" to ~/.zshrc fixes it
  • Mike.R
    Mike.R over 3 years
    Artem R U Sure?