出于某种原因,ipython研究了不同python版本的virtualenv

出于某种原因,ipython研究了不同python版本的virtualenv,ipython,Ipython,所以我有了ipython,它在一段时间内运行良好。然后我使用buildout安装ipdb。 案例是:ipython和python2.7全系统 主文件夹中的裸体python virtualenvs。 主文件夹中的一个plone实例,使用我提到的裸python中的python2.4的virtualenv 现在我试着运行ipython,我得到了 fakedrake@fakedrake-arch ~ $ ipython /home/fakedrake/python/parts/opt/lib/pytho

所以我有了ipython,它在一段时间内运行良好。然后我使用buildout安装ipdb。 案例是:ipython和python2.7全系统 主文件夹中的裸体python virtualenvs。 主文件夹中的一个plone实例,使用我提到的裸python中的python2.4的virtualenv

现在我试着运行ipython,我得到了

fakedrake@fakedrake-arch ~ $ ipython
/home/fakedrake/python/parts/opt/lib/python2.4/pprint.py:39: RuntimeWarning: Python C API version mismatch for module cStringIO: This Python has API version 1013, module cStringIO has versi
on 1012.                                                                                                                                                                                    
  from cStringIO import StringIO as _StringIO
/home/fakedrake/python/parts/opt/lib/python2.4/string.py:528: RuntimeWarning: Python C API version mismatch for module strop: This Python has API version 1013, module strop has version 1012
.                                                                                                                                                                                           
  from strop import maketrans, lowercase, uppercase, whitespace
/home/fakedrake/python/parts/opt/lib/python2.4/unittest.py:51: RuntimeWarning: Python C API version mismatch for module time: This Python has API version 1013, module time has version 1012.
  import time
/home/fakedrake/python/parts/opt/lib/python2.4/heapq.py:132: RuntimeWarning: Python C API version mismatch for module itertools: This Python has API version 1013, module itertools has versi
on 1012.                                                                                                                                                                                    
  from itertools import islice, repeat
/home/fakedrake/python/parts/opt/lib/python2.4/bisect.py:82: RuntimeWarning: Python C API version mismatch for module _bisect: This Python has API version 1013, module _bisect has version 1
012.                                                                                                                                                                                        
  from _bisect import bisect_right, bisect_left, insort_left, insort_right, insort, bisect
/home/fakedrake/python/parts/opt/lib/python2.4/heapq.py:306: RuntimeWarning: Python C API version mismatch for module _heapq: This Python has API version 1013, module _heapq has version 101
2.                                                                                                                                                                                          
  from _heapq import heappush, heappop, heapify, heapreplace, nlargest, nsmallest
Traceback (most recent call last):
  File "/usr/bin/ipython", line 26, in <module>
    import IPython.Shell
  File "/usr/lib/python2.7/site-packages/IPython/__init__.py", line 58, in <module>
    __import__(name,glob,loc,[])
  File "/usr/lib/python2.7/site-packages/IPython/ipstruct.py", line 17, in <module>
    from IPython.genutils import list2dict2
  File "/usr/lib/python2.7/site-packages/IPython/genutils.py", line 20, in <module>
    import doctest
  File "/home/fakedrake/python/parts/opt/lib/python2.4/doctest.py", line 99, in <module>
    import unittest, difflib, pdb, tempfile
  File "/home/fakedrake/python/parts/opt/lib/python2.4/tempfile.py", line 33, in <module>
    from random import Random as _Random
  File "/home/fakedrake/python/parts/opt/lib/python2.4/random.py", line 41, in <module>
    from warnings import warn as _warn
  File "/home/fakedrake/python/parts/opt/lib/python2.4/warnings.py", line 258, in <module>
    simplefilter("ignore", category=OverflowWarning, append=1)
NameError: name 'OverflowWarning' is not defined
fakedrake@fakedrake-阿奇~$ipython
/home/fakedrake/python/parts/opt/lib/python2.4/pprint.py:39:RuntimeWarning:python C API版本与模块cStringIO不匹配:此python的API版本为1013,模块cStringIO的版本为
1012。
从cStringIO将StringIO导入为_StringIO
/home/fakedrake/python/parts/opt/lib/python2.4/string.py:528:运行时警告:python C API版本与模块strop不匹配:此python具有API版本1013,模块strop具有版本1012
.                                                                                                                                                                                           
从strop导入maketrans、小写、大写、空格
/home/fakedrake/python/parts/opt/lib/python2.4/unittest.py:51:RuntimeWarning:pythoncapi版本与模块时间不匹配:此python具有API版本1013,模块时间具有版本1012。
导入时间
/home/fakedrake/python/parts/opt/lib/python2.4/heapq.py:132:运行时警告:模块itertools的python C API版本不匹配:此python具有API版本1013,模块itertools具有版本
1012。
从itertools导入islice,重复
/home/fakedrake/python/parts/opt/lib/python2.4/bisect.py:82:运行时警告:模块_bisect的python C API版本不匹配:此python具有API版本1013,模块_bisect具有版本1
12
从_bisect导入bisect_right,bisect_left,insort_left,insort_right,insort,bisect
/home/fakedrake/python/parts/opt/lib/python2.4/heapq.py:306:运行时警告:python C API版本与模块\u heapq不匹配:此python具有API版本1013,模块\u heapq具有版本101
2.
从_heapq导入heappush、heapop、heapify、heapreplace、nlargest、nsmalest
回溯(最近一次呼叫最后一次):
文件“/usr/bin/ipython”,第26行,在
导入IPython.Shell
文件“/usr/lib/python2.7/site packages/IPython/_init__.py”,第58行,在
__导入(名称、全局、loc、[])
文件“/usr/lib/python2.7/site packages/IPython/ipstruct.py”,第17行,在
从IPython.genutils导入列表2dict2
文件“/usr/lib/python2.7/site packages/IPython/genutils.py”,第20行,在
进口医生测试
文件“/home/fakedrake/python/parts/opt/lib/python2.4/doctest.py”,第99行,在
导入unittest、difflib、pdb、tempfile
文件“/home/fakedrake/python/parts/opt/lib/python2.4/tempfile.py”,第33行,在
从随机导入随机为_随机
文件“/home/fakedrake/python/parts/opt/lib/python2.4/random.py”,第41行,在
从警告导入警告为\u警告
文件“/home/fakedrake/python/parts/opt/lib/python2.4/warnings.py”,第258行,在
simplefilter(“忽略”,类别=溢出警告,追加=1)
NameError:未定义名称“OverflowWarning”
如果你需要任何关于这个问题的进一步信息,请告诉我,我不知道还有什么可能是相关的。。。
(我运行arch linux)

为什么您同时拥有python2.4和python2.7库??当ipython(v2.7)导入doctest时,它将移动到python2.4库中。我将检查PYTHONPATH环境变量以及sys.path,即

import sys, os
print '\n'.join( [p for p in sys.path ] )
print '\n'.join( [[ for

这件事的顺序很重要。找出从python2.4目录导入doctest的原因,然后从sys.path中删除该目录。根据,在升级到python2.5时会删除OverflowWarning,您可能需要检查PYTHONPATH环境变量。