Skip to content


Subversion checkout URL

You can clone with
Download ZIP


document that sync_imports() can't handle "import foo as bar" #1598

fperez opened this Issue · 3 comments

2 participants


Consider (this assumes a cluster is up and running):

from IPython.parallel import Client
rc = Client()
dv = rc[:]
with dv.sync_imports():
    import numpy as np

a user would assume then that np would be defined in the engines, but it's not.


as discussed on IRC, the as foo part of import statements appears to actually be handled entirely outside the import machinery, and thus not accessible to a clean import hook / override. Some ugly frame inspection or similar would be required, so we have no plans to fix this for the time being, other than saying "you can't do that :(".


I think we can close this issue once we add a simple .. warning:: block to the docs pointing this limitation out.


I've changed the label to simply docs since it's really a language limitation, not a bug on our side.

@minrk minrk closed this issue from a commit
@minrk minrk add note about sync_imports
closes #1598
@minrk minrk closed this in 5fbdbb2
@msabramo msabramo referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
@mattvonrocketstein mattvonrocketstein referenced this issue from a commit in mattvonrocketstein/ipython
@minrk minrk add note about sync_imports
closes #1598
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.