3

I've changed the question title to match the actual cause of my problem.

In my 14.04 setup, ipython's subcommands don't work:

$ ipython locate
[TerminalIPythonApp] WARNING | File not found: u'locate'

This is similar to another problem from earlier releases of Ubuntu and IPython. I have the "stock" ipython with Ubuntu 14.04.

Python 2.7.6 (default, Mar 22 2014, 22:59:56) 
Type "copyright", "credits" or "license" for more information.

IPython 1.2.1 -- An enhanced Interactive Python.

I have found that calling ipython2.7 locate, for example, works, and this is a kind of work-around for now, but it generates a warning:

$ ipython2.7 locate
/usr/lib/python2.7/dist-packages/IPython/frontend.py:30: UserWarning: The top-level `frontend` package has been deprecated. All its subpackages have been moved to the top `IPython` level.
  warn("The top-level `frontend` package has been deprecated. "
/home/whoever/.config/ipython

Is there a nice clean way to fix this?

Frank M
  • 316
  • 1
    In my machine all seems to work as expected (but I also get the warning with ipython2.7). What about ipython locate --log-level=DEBUG? – Salem Jul 30 '14 at 19:06
  • Thanks, that effectively solved my problem: It got me to realize that I've set up alias ipython='/usr/bin/ipython --pylab qt in my .bash_profile. So my problem is fundamentally "pilot error." When I use /usr/bin/ipython locate I get the expected result. – Frank M Jul 30 '14 at 22:44
  • Frank please write your solution and mark it as solved. – Salem Aug 01 '14 at 04:24

2 Answers2

2

I feel a little foolish "answering" my own question when it really is a matter of pilot error. On the other hand, other people might have the same problem I had, forgetting that we've cleverly aliased a common shell command, and then wondering why it no longer works as advertised. This issue has bitten me several times.

The solution, if your ~/.bash_profile or ~/.bashrc files have "alias" commands in them and they don't work as expected, is to try calling the program by its explicit path. In my case,

ipython somecommand somescript.py

triggers the shell's alias expansion, but

/usr/bin/ipython somecommand somescript.py

Does not.

Frank M
  • 316
0

To avoid shell expations of the alias in bash, you may call it using either

\ipython whatever

or

"ipython" whatever

Thanks for your localization of the problem (i mean aliases).