Skip to content
This repository has been archived by the owner on Sep 14, 2018. It is now read-only.

IronPython module import issues with IPython 1.0 - AttributeError: 'module' object has no attribute 'core' #123

Closed
kerray opened this issue Sep 3, 2013 · 6 comments

Comments

@kerray
Copy link

kerray commented Sep 3, 2013

I've originally tried to get to the bottom of this in ipython/ipython#4062

My question here is, why do the imports in IronPython behave differently than in cPython? Any ideas what would be the right way to solve/work around this?

Thanks

@jdhardy
Copy link
Member

jdhardy commented Sep 3, 2013

I ran into this myself over the weekend and I couldn't quite figure it out either. Directly importing IPython.core immediately before it doesn't work either. I'm think there must be something special about the IPython module namespace that's tripping up IronPython, but I haven't figured out what it is yet.

@bfibrich
Copy link

bfibrich commented Oct 1, 2013

Any ideas anyone? I have the same problem though using suggestions ipython/ipython#4062 I still get issues.

@swinstanley
Copy link

(copied this from same response in issue linked above).

There does seem to be some bug in IronPython 2.7.x (9cbff4c) with ipython-2.0.0-dev ebf12123833c207995a03dc9bb542ecf35cc1dcc related to the way modules are imported which breaks the ipython "shell" script.

I found this code successful

from IPython import core as C
import IPython
IPython.core = C
from IPython import start_ipython
start_ipython()

It's something to do with the PlatformAdaptionLayer and wierd behaviour with nested packages in IronPython which I can't quite pin down. However the workaround is "working" at the moment.

@paweljasinski
Copy link
Contributor

I have commited a fix in IronPython (94b55df in ipy-2.7-maint)
Details: https://ironpython.codeplex.com/workitem/34551

On Fri, Oct 18, 2013 at 3:17 PM, swinstanley notifications@github.comwrote:

(copied this from same response in issue linked above).

There does seem to be some bug in IronPython 2.7.x (9cbff4chttps://github.com/IronLanguages/main/commit/9cbff4cfde6d2071a8158c54535cd1bc83c82e32)
with ipython-2.0.0-dev ebf1212ebf12123833c207995a03dc9bb542ecf35cc1dccrelated to the way modules are imported which breaks the ipython "shell"
script.

I found this code successful

from IPython import core as Cimport IPythonIPython.core = Cfrom IPython import start_ipythonstart_ipython()

It's something to do with the PlatformAdaptionLayer and wierd behaviour
with nested packages in IronPython which I can't quite pin down. However
the workaround is "working" at the moment.


Reply to this email directly or view it on GitHubhttps://github.com//issues/123#issuecomment-26594500
.

@varzan
Copy link

varzan commented Jan 31, 2014

Looks like this has been fixed and can be closed?

@paweljasinski
Copy link
Contributor

Just for the record I will maintain forks/branches for the purpose of using ipython under IronPython.

https://github.com/paweljasinski/IronLanguages/tree/ipython-notepad - patches in IronPython
https://github.com/paweljasinski/pyzmq/tree/iron-cleanup - pyzmq - ctype backend for IronPython
https://github.com/paweljasinski/tornado/tree/iron-wip - patches in tornado
https://github.com/paweljasinski/ipython/tree/iron-notepad - patches in ipython
https://github.com/paweljasinski/pyreadline - patches in readline

Once merged into the official tree, branches will disappear. ipython and tornado will stay forever, as there is no intention to merge 2.x based IronPython changes into the master.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants