[IPython-user] sh profile should preserve the reserved python words

Fernando Perez fperez.net at gmail.com
Sun Jun 4 20:06:40 CDT 2006


On 6/4/06, Krishna Mohan Gundu <gkmohan at gmail.com> wrote:
> Dear Fernando,
>
> When I said fails I meant it runs the system 'import' command and
> exits, rather than running the python import command. There is no
> traceback. If I delete the entry
> aS 'import'
> from ~/.ipython/db/syscmdlist, it works fine.
>
> Do you have import in your ~/.ipython/db/syscmdlist? If not did you
> have the lmageMagick import command in your path when you ran 'ipython
> -p  sh' for the first time?
>
> I have not looked into the magic command "rehashx". How do the magic
> commands work in sh profile. Is it supposed to alias all system
> commands first and then ignore if it clashes with reserved words, when
> initiated. Or ignore the command altogether?

I see it if I run with no ~/.ipython dir (so ipython makes a new one),
but ipython prints this:

longs[~]> ip -p sh

System command list not initialized, probably the first run...
running %rehashx to refresh the command list. Run %rehashx
again to refresh command list (after installing new software etc.)

Py 2.4.3 (#2, Apr 27 2006, 14:43:58)  IPy 0.7.2


By following the instructions, it works fine:

[~]|1> rehashx
[~]|2> import math
[~]|3> math.sin(math.pi)
   <3> 1.2246063538223773e-16


Did you do as the message indicated?

Cheers,

f




More information about the IPython-user mailing list