我是Elkner's How To Think的自學Python,已經到了第7章,字符串。我試圖通過鍵入進口字符串加載字符串模塊,它似乎工作,但是這是我得到:字符串模塊出錯,python os x
>>> import string
>>> dir (string)
['__builtins__', '__doc__', '__file__', '__name__', '__package__', 'string']
和,容易混淆,我的幫助功能似乎已經死了一些相關的原因:
>>> help()
['__builtins__', '__doc__', '__file__', '__name__', '__package__', 'string']
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 458, in __call__
import pydoc
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pydoc.py", line 57, in <module>
from string import expandtabs, find, join, lower, split, strip, rfind, rstrip
ImportError: cannot import name expandtabs
我做錯了什麼?我怎樣才能解決這個問題?運行Mac OS X 10.7.1。