Thanks Chris!<br>I tried using "!" instead of "run". It works but with a significant performance penalty.<br><br>Best regards,<br>Johan<br><br><br><div class="gmail_quote">On Fri, Aug 19, 2011 at 5:11 PM, Chris Rebert <span dir="ltr"><<a href="mailto:clp2@rebertia.com">clp2@rebertia.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="h5">On Fri, Aug 19, 2011 at 6:00 AM, Johan Ekh <<a href="mailto:ekh.johan@gmail.com">ekh.johan@gmail.com</a>> wrote:<br>
> Hi all,<br>
> I have a script "myscript.py" located in "/usr/local/bin" on my linux box.<br>
> I can execute it in ipython with<br>
><br>
> run /usr/local/bin/myscript.py<br>
><br>
> but not with<br>
><br>
> run myscript.py<br>
><br>
> even though /usr/local/bin is in my $PATH and in my $PYTHONPATH.<br>
><br>
> What should I do to correct this?<br>
<br>
</div></div>Given that %run takes a filename and not a module name, I doubt<br>
PYTHONPATH matters. ipython's docs for %run don't seem to indicate<br>
that a search of any kind is performed. So, I'd say you have to either<br>
pass a valid absolute or relative path to myscript.py, or run<br>
myscript.py from bash instead of ipython.<br>
<br>
Changing your script's shebang line to ipython might also work<br>
(haven't tried it myself). Or you could try patching ipython's run()<br>
function to add this search feature you desire.<br>
<br>
Cheers,<br>
Chris<br>
<font color="#888888">--<br>
<a href="http://rebertia.com" target="_blank">http://rebertia.com</a><br>
</font></blockquote></div><br>