ipython help doesn't work properly because curses setupterm cannot find the terminal
By Deil.Christ... on April 13, 2012 00:59 (imported from Google Code)
What steps will reproduce the problem?
- Install the development version of ipython (http://ipython.org/)
- Start ipython (by typing ipython in the shell)
- Type "int?" and ENTER
What is the expected output? What do you see instead?
I expect to see the help for python integers. You can see this by typing "help(int)" instead or by typing "int?" in the default Mac Terminal App (there is works just fine).
Instead I get an error from the python curses library, which in my case was installed via Macports:
In [1]: int?
---------------------------------------------------------------------------
error Traceback (most recent call last)
/Users/deil/code/cython/<ipython-input-1-bd0a4f8c5f8e> in <module>()
----> 1 get_ipython().magic(u'pinfo int')
/Users/deil/Library/Python/2.7/lib/python/site-packages/IPython/core/interactiveshell.pyc in magic(self, arg_s, next_input)
2032 self._magic_locals = sys._getframe(1).f_locals
2033 with self.builtin_trap:
-> 2034 result = fn(magic_args)
2035 # Ensure we're not keeping object references around:
2036 self._magic_locals = {}
/Users/deil/Library/Python/2.7/lib/python/site-packages/IPython/core/magic.pyc in magic_pinfo(self, parameter_s, namespaces)
559 else:
560 self.shell._inspect('pinfo', oname, detail_level=detail_level,
--> 561 namespaces=namespaces)
562
563 def magic_pinfo2(self, parameter_s='', namespaces=None):
/Users/deil/Library/Python/2.7/lib/python/site-packages/IPython/core/interactiveshell.pyc in _inspect(self, meth, oname, namespaces, **kw)
1450 pmethod(info.obj, oname, formatter)
1451 elif meth == 'pinfo':
-> 1452 pmethod(info.obj, oname, formatter, info, **kw)
1453 else:
1454 pmethod(info.obj, oname)
/Users/deil/Library/Python/2.7/lib/python/site-packages/IPython/core/oinspect.pyc in pinfo(self, obj, oname, formatter, info, detail_level)
482 # Finally send to printer/pager:
483 if displayfields:
--> 484 page.page(self._format_fields(displayfields))
485
486 def info(self, obj, oname='', formatter=None, info=None, detail_level=0):
/Users/deil/Library/Python/2.7/lib/python/site-packages/IPython/core/page.pyc in page(strng, start, screen_lines, pager_cmd)
182 if screen_lines <= 0:
183 try:
--> 184 screen_lines += _detect_screen_size(use_curses, screen_lines_def)
185 except (TypeError, UnsupportedOperation):
186 print >>io.stdout, str_toprint
/Users/deil/Library/Python/2.7/lib/python/site-packages/IPython/core/page.pyc in _detect_screen_size(use_curses, screen_lines_def)
108
109 # Proceed with curses initialization
--> 110 scr = curses.initscr()
111 screen_lines_real,screen_cols = scr.getmaxyx()
112 curses.endwin()
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/curses/init.pyc in initscr()
31 # instead of calling exit() in error cases.
32 setupterm(term=_os.environ.get("TERM", "unknown"),
---> 33 fd=_sys.stdout.fileno())
34 stdscr = _curses.initscr()
35 for key, value in _curses.dict.items():
error: setupterm: could not find terminal
What version of the product are you using? On what operating system?
Build 1.0.0.20110821
Mac OS X Lion with XCode 4.3