无法导入 tpot

Cannot import tpot

我按照此处给出的所有步骤安装了 tpot 机器学习库:http://epistasislab.github.io/tpot/installing/

当我查看 pip3 列表时,我可以看到安装了 tpot。

下面是我的简单源代码[https://github.com/EpistasisLab/tpot]:

from tpot import TPOTClassifier
from sklearn.datasets import load_digits
from sklearn.model_selection import train_test_split
digits = load_digits()
X_train, X_test, y_train, y_test = train_test_split(digits.data, digits.target,
                                                    train_size=0.75, test_size=0.25)

tpot = TPOTClassifier(generations=5, population_size=20, verbosity=2)
tpot.fit(X_train, y_train)
print(tpot.score(X_test, y_test))
tpot.export('tpot_mnist_pipeline.py')

我收到以下错误:

Traceback (most recent call last):
  File "test.py", line 1, in <module>
    from tpot import TPOTClassifier
ModuleNotFoundError: No module named 'tpot'

我现在不确定是什么原因造成的。我检查了模块的 GitHub 问题并遵循了那里给出的所有解决方案。我正在使用通过 Homebrew

安装的 Max OS high Sierra 和 Python

我遇到了同样的问题,这似乎是由于脚本被命名为 tpot.py。将其更改为其他内容,它应该可以工作:)