Python 模块没有完全安装

Python module not installing completely

我创建了一个 python 具有以下层次结构的模块

Git 存储库:Zeus | Machine Learning Library

但是每当我运行命令

python setup.py install

它成功安装了模块,但是当我尝试从子模块导入任何东西时,它给出了一个错误,例如。

当我在我的 python 终端中 运行 这个时

import zeus

它工作得很好,但是当我 运行 这个

from zeus.tree import classifiers

它给我以下错误

Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    from zeus.tree import classifiers
ModuleNotFoundError: No module named 'zeus.tree'

我猜这是我的 init.py 的问题,但不知道它到底是什么。

    # -*- coding: utf-8 -*-

    from distutils.core import setup

    setup(
        name = "zeus",
        version = "0.1",
        author = "yourname",
        author_email = "youraddress@xyz.com",
        description = ("A simple and easy to use Machine Learning Library."),
        license = "GPL-2,0",
        packages=['zeus', 'zeus.tree', 'zeus.linear_regressors'],
        install_requires=['numpy'],
        zip_safe=False
    )

您的包装不包含导致导入错误的子模块。更改后的行是:

    packages=['zeus', 'zeus.tree', 'zeus.linear_regressors'] 

相反,您只有:

    packages=['zeus']