2013-06-12 43 views
0

turbogears與Ipython集成了paster shell。 這個工作,你必須在virtualenv中我沒有使用版本0.10.2(或更少)ipython 0.10.2與turbogears paster shell墜毀

這樣:

pip install ipython=0.10.2 

當我運行貼殼我得到:

哎呀,IPython中墜毀。我們盡我們所能,使之穩定,但是......

A crash report was automatically generated with the following information: 
    - A verbatim copy of the crash traceback. 
    - A copy of your input history during this session. 
    - Data on your current IPython configuration. 

這裏是IPython的崩潰轉貼


IPython post-mortem report 

IPython version: 0.10.2 

Platform info : os.name -> nt, sys.platform -> win32 

*************************************************************************** 

Current user configuration structure: 

{'Version': 0, 
'__allownew': True, 
'alias': [], 
'args': [], 
'autocall': 1, 
'autoedit_syntax': 0, 
'autoexec': [], 
'autoindent': 1, 
'automagic': 1, 
'banner': 1, 
'c': '', 
'cache_size': 1000, 
'classic': 0, 
'color_info': 1, 
'colors': 'Linux', 
'confirm_exit': 1, 
'debug': 0, 
'deep_reload': 0, 
'editor': '0', 
'execfile': [], 
'execute': [''], 
'gthread': 0, 
'help': 0, 
'import_all': [], 
'import_mod': [], 
'import_some': [[]], 
'include': [], 
'interact': 0, 
'ipythondir': u'c:\\users\\alonisser\\_ipython', 
'log': 0, 
'logfile': '', 
'logplay': '', 
'magic_docstrings': 0, 
'messages': 1, 
'multi_line_specials': 1, 
'nosep': 0, 
'object_info_string_level': 0, 
'opts': Struct({'__allownew': True}), 
'pdb': 0, 
'pprint': 1, 
'profile': '', 
'prompt_in1': 'In [\\#]: ', 
'prompt_in2': ' .\\D.: ', 
'prompt_out': 'Out[\\#]: ', 
'prompts_pad_left': 1, 
'pydb': 0, 
'pylab': 0, 
'pylab_import_all': 1, 
'q4thread': 0, 
'qthread': 0, 
'quick': 0, 
'quiet': 0, 
'rcfile': 'ipythonrc.ini', 
'readline': 1, 
'readline_merge_completions': 1, 
'readline_omit__names': 0, 
'readline_parse_and_bind': ['tab: complete', 
          '"\\C-l": possible-completions', 
          'set show-all-if-ambiguous on', 
          '"\\C-o": tab-insert', 
          '"\\M-i": " "', 
          '"\\M-o": "\\d\\d\\d\\d"', 
          '"\\M-I": "\\d\\d\\d\\d"', 
          '"\\C-r": reverse-search-history', 
          '"\\C-s": forward-search-history', 
          '"\\C-p": history-search-backward', 
          '"\\C-n": history-search-forward', 
          '"\\e[A": history-search-backward', 
          '"\\e[B": history-search-forward', 
          '"\\C-k": kill-line', 
          '"\\C-u": unix-line-discard'], 
'readline_remove_delims': '-/~', 
'screen_length': 0, 
'separate_in': '\\n', 
'separate_out': '0', 
'separate_out2': '0', 
'system_header': 'IPython system call: ', 
'system_verbose': 1, 
'term_title': 1, 
'tk': 0, 
'upgrade': 0, 
'wildcards_case_sensitive': 1, 
'wthread': 0, 
'wxversion': '0', 
'xmode': 'Context'} 

*************************************************************************** 

Crash traceback: 

--------------------------------------------------------------------------- 
TypeError    Python 2.7.4: c:\dev\envs\agents\Scripts\python.exe 
                Tue Jun 11 15:39:42 2013 
A problem occured executing Python code. Here is the sequence of function 
calls leading up to the error, with the most recent (innermost) call last. 

c:\dev\envs\agents\Scripts\ipython-script.py in <module>() 
     1 
     2 
     3 
     4 
     5 
     6 
     7 
----> 8 
     global load_entry_point = <function load_entry_point at 0x022EBBF0> 
     9 #!c:\dev\envs\agents\Scripts\python.exe 
    10 # EASY-INSTALL-ENTRY-SCRIPT: 'ipython==0.10.2','console_scripts','ipython' 
    11 __requires__ = 'ipython==0.10.2' 
    12 import sys 
    13 from pkg_resources import load_entry_point 
    14 
    15 sys.exit(
    16 load_entry_point('ipython==0.10.2', 'console_scripts', 'ipython')() 
    17) 
    18 
    19 
    20 
    21 
    22 
    23 
    24 
    25 
    26 
    27 
    28 
    29 
    30 
    31 

c:\dev\envs\agents\lib\site-packages\IPython\ipapi.pyc in launch_new_instance(user_ns=None, shellclass=None) 
    541 
    542  def check_hotname(self,name): 
    543   if name in self.hotnames: 
    544    self.debug_stack("HotName '%s' caught" % name) 
    545 
    546 
    547 def launch_new_instance(user_ns = None,shellclass = None): 
    548  """ Make and start a new ipython instance. 
    549  
    550  This can be called even without having an already initialized 
    551  ipython session running. 
    552  
    553  This is also used as the egg entry point for the 'ipython' script. 
    554  
    555  """ 
--> 556  ses = make_session(user_ns,shellclass) 
    557  ses.mainloop() 
    558 
    559 
    560 def make_user_ns(user_ns = None): 
    561  """Return a valid user interactive namespace. 
    562 
    563  This builds a dict with the minimal information needed to operate as a 
    564  valid IPython user namespace, which you can pass to the various embedding 
    565  classes in ipython. 
    566 
    567  This API is currently deprecated. Use ipapi.make_user_namespaces() instead 
    568  to make both the local and global namespace objects simultaneously. 
    569 
    570  :Parameters: 
    571   user_ns : dict-like, optional 

c:\dev\envs\agents\lib\site-packages\IPython\ipapi.pyc in make_session(user_ns=None, shellclass=None) 
    669 
    670 def make_session(user_ns = None, shellclass = None): 
    671  """Makes, but does not launch an IPython session. 
    672  
    673  Later on you can call obj.mainloop() on the returned object. 
    674 
    675  Inputs: 
    676 
    677  - user_ns(None): a dict to be used as the user's namespace with initial 
    678  data. 
    679  
    680  WARNING: This should *not* be run when a session exists already.""" 
    681 
    682  import IPython.Shell 
    683  if shellclass is None: 
--> 684   return IPython.Shell.start(user_ns) 
    685  return shellclass(user_ns = user_ns) 
    686 
    687 
    688 
    689 
    690 
    691 
    692 
    693 
    694 
    695 
    696 
    697 
    698 
    699 

c:\dev\envs\agents\lib\site-packages\IPython\Shell.pyc in start(user_ns=None) 
    1227    th_mode = special_opts.pop() 
    1228   except KeyError: 
    1229    th_mode = 'tkthread' 
    1230   return th_shell[th_mode] 
    1231 
    1232 
    1233 # This is the one which should be called by external code. 
    1234 def start(user_ns = None): 
    1235  """Return a running shell instance, dealing with threading options. 
    1236 
    1237  This is a factory function which will instantiate the proper IPython shell 
    1238  based on the user's threading choice. Such a selector is needed because 
    1239  different GUI toolkits require different thread handling details.""" 
    1240 
    1241  shell = _select_shell(sys.argv) 
-> 1242  return shell(user_ns = user_ns) 
    1243 
    1244 # Some aliases for backwards compatibility 
    1245 IPythonShell = IPShell 
    1246 IPythonShellEmbed = IPShellEmbed 
    1247 #************************ End of file <Shell.py> *************************** 
    1248 
    1249 
    1250 
    1251 
    1252 
    1253 
    1254 
    1255 
    1256 
    1257 

c:\dev\envs\agents\lib\site-packages\IPython\Shell.pyc in __init__(self=<IPython.Shell.IPShell instance>, argv=None, user_ns=None, user_global_ns=None, debug=1, shell_class=<class 'IPython.iplib.InteractiveShell'>) 
    58 # Default timeout for waiting for multithreaded shells (in seconds) 
    59 GUI_TIMEOUT = 10 
    60 
    61 #----------------------------------------------------------------------------- 
    62 # This class is trivial now, but I want to have it in to publish a clean 
    63 # interface. Later when the internals are reorganized, code that uses this 
    64 # shouldn't have to change. 
    65 
    66 class IPShell: 
    67  """Create an IPython instance.""" 
    68  
    69  def __init__(self,argv=None,user_ns=None,user_global_ns=None, 
    70     debug=1,shell_class=InteractiveShell): 
    71   self.IP = make_IPython(argv,user_ns=user_ns, 
    72        user_global_ns=user_global_ns, 
---> 73        debug=debug,shell_class=shell_class) 
     global For = undefined 
     global more = undefined 
     global details = undefined 
     global see = undefined 
     global the = undefined 
     global __call__ = undefined 
     global method = undefined 
     global below. = undefined 
    74 
    75  def mainloop(self,sys_exit=0,banner=None): 
    76   self.IP.mainloop(banner) 
    77   if sys_exit: 
    78    sys.exit() 
    79 
    80 #----------------------------------------------------------------------------- 
    81 def kill_embedded(self,parameter_s=''): 
    82  """%kill_embedded : deactivate for good the current embedded IPython. 
    83 
    84  This function (after asking for confirmation) sets an internal flag so that 
    85  an embedded IPython will never activate again. This is useful to 
    86  permanently disable a shell that is being called inside a loop: once you've 
    87  figured out what you needed from it, you may then kill it and the program 
    88  will then continue to run without the interactive shell interfering again. 

c:\dev\envs\agents\lib\site-packages\IPython\ipmaker.pyc in make_IPython(argv=[r'c:\dev\envs\agents\Scripts\ipython-script.py'], user_ns=None, user_global_ns=None, debug=1, rc_override=None, shell_class=<class 'IPython.iplib.InteractiveShell'>, embedded=False, **kw={}) 
    506  # tweaks. Basically options which affect other options. I guess this 
    507  # should just be written so that options are fully orthogonal and we 
    508  # wouldn't worry about this stuff! 
    509 
    510  if IP_rc.classic: 
    511   IP_rc.quick = 1 
    512   IP_rc.cache_size = 0 
    513   IP_rc.pprint = 0 
    514   IP_rc.prompt_in1 = '>>> ' 
    515   IP_rc.prompt_in2 = '... ' 
    516   IP_rc.prompt_out = '' 
    517   IP_rc.separate_in = IP_rc.separate_out = IP_rc.separate_out2 = '0' 
    518   IP_rc.colors = 'NoColor' 
    519   IP_rc.xmode = 'Plain' 
    520 
--> 521  IP.pre_config_initialization() 
    522  # configure readline 
    523 
    524  # update exception handlers with rc file status 
    525  otrap.trap_out() # I don't want these messages ever. 
    526  IP.magic_xmode(IP_rc.xmode) 
    527  otrap.release_out() 
    528 
    529  # activate logging if requested and not reloading a log 
    530  if IP_rc.logplay: 
    531   IP.magic_logstart(IP_rc.logplay + ' append') 
    532  elif IP_rc.logfile: 
    533   IP.magic_logstart(IP_rc.logfile) 
    534  elif IP_rc.log: 
    535   IP.magic_logstart() 
    536 

c:\dev\envs\agents\lib\site-packages\IPython\iplib.pyc in pre_config_initialization(self=<IPython.iplib.InteractiveShell object>) 
    820       self.user_ns, # globals 
    821       # Skip our own frame in searching for locals: 
    822       sys._getframe(depth+1).f_locals # locals 
    823       )) 
    824 
    825  def pre_config_initialization(self): 
    826   """Pre-configuration init method 
    827 
    828   This is called before the configuration files are processed to 
    829   prepare the services the config files might need. 
    830   
    831   self.rc already has reasonable default values at this point. 
    832   """ 
    833   rc = self.rc 
    834   try: 
--> 835    self.db = pickleshare.PickleShareDB(rc.ipythondir + "/db") 
     global Optional = undefined 
     global inputs = undefined 
    836   except exceptions.UnicodeDecodeError: 
    837    print "Your ipythondir can't be decoded to unicode!" 
    838    print "Please set HOME environment variable to something that" 
    839    print r"only has ASCII characters, e.g. c:\home" 
    840    print "Now it is",rc.ipythondir 
    841    sys.exit() 
    842   self.shadowhist = IPython.history.ShadowHist(self.db) 
    843 
    844  def post_config_initialization(self): 
    845   """Post configuration init method 
    846 
    847   This is called after the configuration files have been processed to 
    848   'finalize' the initialization.""" 
    849 
    850   rc = self.rc 

c:\dev\envs\agents\lib\site-packages\IPython\Extensions\pickleshare.pyc in __init__(self=PickleShareDB('c:\users\alonisser\_ipython\db'), root=u'c:\\users\\alonisser\\_ipython/db') 
    38 import cPickle as pickle 
    39 import UserDict 
    40 import warnings 
    41 import glob 
    42 
    43 def gethashfile(key): 
    44  return ("%02x" % abs(hash(key) % 256))[-2:] 
    45 
    46 _sentinel = object() 
    47 
    48 class PickleShareDB(UserDict.DictMixin): 
    49  """ The main 'connection' object for PickleShare database """ 
    50  def __init__(self,root): 
    51   """ Return a db object that will manage the specied directory""" 
    52   self.root = Path(root).expanduser().abspath() 
---> 53   if not self.root.isdir(): 
    54    self.root.makedirs() 
    55   # cache has { 'key' : (obj, orig_mod_time) } 
    56   self.cache = {} 
    57   
    58 
    59  def __getitem__(self,key): 
    60   """ db['key'] reading """ 
    61   fil = self.root/key 
    62   try: 
    63    mtime = (fil.stat()[stat.ST_MTIME]) 
    64   except OSError: 
    65    raise KeyError(key) 
    66 
    67   if fil in self.cache and mtime == self.cache[fil][1]: 
    68    return self.cache[fil][0] 

TypeError: _isdir() takes exactly 1 argument (0 given) 

*************************************************************************** 

History of session input: 

*** Last line of input (may not be in above history): 

什麼想法?

我是一個Windows 7用戶,並且通常(virtualenv之外)Ipython 0.13.2工作正常。

編輯:澄清:我沒有卸載和安裝,卸載後有沒有IPython的文件夾或文件在ENV \ LIB \站點包文件夾後

安裝,同樣的錯誤返回

回答

0

你有兩個安裝?回溯看起來不連貫,就好像你有過時的pyc文件,而0.10.2正在讀取0.13.1文件。

+0

都已安裝,一個是系統默認值,另一個是virtualenv。一個陳舊的pyc是可能的(因爲我複製了一些virtualenv)。在哪裏尋找它? – alonisser

+0

例如,查看諸如'c:\ dev \ envs \ agents \ lib \ site-packages \ IPython \ ipmaker.pyc'的回溯.pyc文件。沒有很多的經驗與Windows – Matt

+0

我很確定這不是問題,因爲卸載Ipython後,這些文件不再存在(檢查),但重新安裝後,我得到相同的錯誤 – alonisser

0

你試過刪除你的個人資料文件夾嗎? 在Linux中它有點像$HOME/.ipython

當我遇到IPython的問題時,這總能幫助我。