2011-05-08 4 views
0

그래서 ipython이 있었고 잠시 동안 잘 작동했습니다. 그런 다음 buildout을 사용하여 ipdb를 설치했습니다. 사례 : ipython 및 python2.7 시스템 전체 홈 폴더에 naked-python virtualenvs가 있습니다. 내가 ipython를 실행하려고하고 문제에 관한 자세한 정보가 필요하면 내가ipython은 어떤 이유에서든 다른 파이썬 버전의 virtualenv를 찾습니다.

[email protected] ~ $ 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 

을 얻을 지금

언급 벌거 벗은 - 파이썬에서 python2.4의 VIRTUALENV를 사용하여 홈 폴더에있는 플론 (Plone) 인스턴스 그냥 말해, 다른 사람이 관련성이 있을지 모르겠다. (내가 arch-linux를 실행한다.)

+0

PYTHONPATH 환경 변수를 확인해야 할 수 있습니다. –

답변

0

왜 python2.4와 python 2.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 

이 순서는 중요합니다. doctest가 python2.4 디렉토리에서 가져 오는 이유를 파악한 다음 sys.path에서 해당 디렉토리를 제거하십시오. here에 따르면 python2.5로 업그레이드하면 OverflowWarning이 제거됩니다.

관련 문제