Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Better support Pypy #719

fperez opened this Issue · 5 comments

3 participants


With pypy 1.6, ipython 0.10.2 works reasonably well, but current master completely fails to even start, with this error:

Original exception was:
Traceback (most recent call last):
  File "", line 53, in run_toplevel
  File "/home/fperez/usr/bin//ipython", line 7, in 
  File "/home/fperez/usr/lib/python2.6/site-packages/IPython/frontend/terminal/", line 385, in launch_new_instance
  File "/home/fperez/usr/lib/python2.6/site-packages/IPython/frontend/terminal/", line 299, in initialize
  File "/home/fperez/usr/lib/python2.6/site-packages/IPython/frontend/terminal/", line 319, in init_shell
  File "/home/fperez/usr/lib/python2.6/site-packages/IPython/config/", line 295, in instance
    inst = cls(*args, **kwargs)
  File "/home/fperez/usr/lib/python2.6/site-packages/IPython/frontend/terminal/", line 113, in __init__
    user_global_ns=user_global_ns, custom_exceptions=custom_exceptions
  File "/home/fperez/usr/lib/python2.6/site-packages/IPython/core/", line 388, in __init__
  File "/home/fperez/usr/lib/python2.6/site-packages/IPython/core/", line 1399, in init_history
    self.history_manager = HistoryManager(shell=self, config=self.config)
  File "/home/fperez/usr/lib/python2.6/site-packages/IPython/core/", line 127, in __init__
  File "/home/fperez/usr/lib/python2.6/site-packages/IPython/core/", line 154, in new_session
    self.session_number = cur.lastrowid
  File "/home/fperez/usr/lib/python2.6/site-packages/IPython/utils/", line 302, in __set__
    new_value = self._validate(obj, value)
  File "/home/fperez/usr/lib/python2.6/site-packages/IPython/utils/", line 310, in _validate
    return self.validate(obj, value)
  File "/home/fperez/usr/lib/python2.6/site-packages/IPython/utils/", line 873, in validate
    self.error(obj, value)
  File "/home/fperez/usr/lib/python2.6/site-packages/IPython/utils/", line 333, in error
    raise TraitError(e)
TraitError: The 'session_number' trait of a HistoryManager instance must be an integer, but a value of 590L  was specified.

We should look into making the traits type checks be more pypy-friendly, if possible. Pypy now has preliminary numpy support, so it's starting to become slowly a contender for scientific use.


it's probably pretty easy to get the traits, etc. working for terminal IPython. However, I think the qtconsole, notebook, and parallel code are simply nonstarters thanks to pyzmq.


Sure! I just figured we should do our best, for now, to keep the console/readline ipython working in pypy.

Later, as they make more progress on extension support, we'll see about the pieces that need zmq, but all that worries me much less.

We've always said there is a 'core' part of ipython that runs with only the stdlib. That's the part I want to try to keep pypy-friendly.


I've done this a couple of times, and kept meaning to commit the fix. Changing Int to CInt gets it started, but there are still some problems with readline.

@takluyver takluyver referenced this issue from a commit in takluyver/ipython
@takluyver takluyver Use casting trait for session number in history, so IPython will star…
…t on PyPy.

Closes gh-719

There's still room for improvement here, but PR #722 should have closed this, but the auto-close failed.

@minrk minrk closed this
@ellisonbg ellisonbg 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
@takluyver takluyver Use casting trait for session number in history, so IPython will star…
…t on PyPy.

Closes gh-719
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.