This question already has an answer here:
ipython inside virtualenv on my macOS. My PATH environment variable also shows virtualenv path to be at the beginning.
which command also shows that
ipython at the correct location.
The problem is, when I run
ipython, the shell is finding the previous installation in an odd place. Here's some examples:
(csv_import) $ ipython -bash: /usr/local/bin/ipython: /usr/local/opt/python3/bin/python3.6: bad interpreter: No such file or directory (csv_import) $ (csv_import) $ which ipython /Users/zeinep/.virtualenvs/csv_import/bin/ipython (csv_import) $ (csv_import) $ echo $PATH /Users/zeinep/.virtualenvs/csv_import/bin:/Users/zeinep/.avn/bin:/Users/zeinep/.nvm/versions/node/v10.14.1/bin:/usr/local/lib/python3.6/bin:/Users/zeinep/Library/Python/3.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin (csv_import) $ (csv_import) $ (csv_import) $ /Users/zeinep/.virtualenvs/csv_import/bin/ipython Python 3.6.5 (default, Jun 17 2018, 12:13:06) Type 'copyright', 'credits' or 'license' for more information IPython 7.3.0 -- An enhanced Interactive Python. Type '?' for help. In :
As can be seen, if I use a full path, it works. Otherwise, old installation at
/usr/local/bin/ipython is run even though the shell should be finding the one in in virtualenv as far as I can see.