Sunday, May 5, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 1356  / 2 Years ago, mon, july 4, 2022, 2:56:34

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?


More From » 14.04

 Answers
6

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.


[#23899] Tuesday, July 5, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
rtbrbab

Total Points: 461
Total Questions: 126
Total Answers: 117

Location: Saudi Arabia
Member since Fri, Jul 1, 2022
2 Years ago
;