[IPython-User] Parallel question: loading ipython profile for each view

Fernando Perez fperez.net@gmail....
Mon Apr 23 01:34:44 CDT 2012

Hi Young

On Mon, Feb 6, 2012 at 10:36 PM, Youngung Jeong
<youngung.jeong@gmail.com> wrote:
> I just started IPython parallel and found it very useful.
> However, there's something I probably missing: a way to load a IPython
> profile for each view.
> Some of the modules I have import some others from subdirectories. For that,
> those particular
> directories are appended to os.sys.path in my default profile.
> However, since I don't know how to load a specific profile for each of
> views, I had to do something like:
>         view.execute('import os')
>         view.execute('cwd = os.getcwd()')
>         view.execute("apath = os.path.join(cwd, 'thesubdirectory')")
>         view.execute("os.sys.path.append(apath)")
> Which is very tedious.
> Is there any handy way to deal with this problem?

No, the notion of mixing profile information like this runs fairly
counter to how we've designed the profile system, which is precisely
geared towards *isolating* things between profiles.

If you need something from more than one profile, the solution is to
put it in a place available to all profiles (such as somewhere in your
PYTHONPATH) and then import it from all of them.



More information about the IPython-User mailing list