【发布时间】:2011-10-30 15:39:59
【问题描述】:
我正在尝试使用 itertools 模块来使用 permutations 函数,但我的 Mac 出现问题。
我一直在使用 linux 的另一台计算机上编程,使用代码没有问题。
import itertools
ps = itertools.permutations(m)
这是我在 Mac 上工作时遇到的错误:
AttributeError: 'module' object has no attribute 'permutations'
有人知道我如何在 Mac 中使用“itertools”吗?
【问题讨论】:
-
你能告诉我们你安装了哪个版本的python吗?
python --version