Python:ModuleNotFoundError:运行安装的软件包时找不到名为“ core”的模块

时间:2020-07-31 01:30:36

标签: python python-3.x

这是我的包裹结构:

 "max_score": 0.9168506,
        "hits": [
            {
                "_index": "my-index",
                "_type": "_doc",
                "_id": "1",
                "_score": 0.9168506,
                "_source": {
                    "title": "This is a sample text to show how the search results works"
                }
            }
        ]

我的app.py包含以下导入:

upgradehost
    |
    |_ _ upgradehost
    |   |
    |   |_ app.py 
    |   |
    |   |_ core.py
    |   |
    |   |_ stable.py
    |   |
    |   |_ __init__.py
    |
    |_ _ doc
    |
    |_ _ test
    |
    |_ _ setup.py
    |
    |_ _ __init__.py

我的setup.py将以下内容作为setuptools.setup()的参数

from core import customlogger, upgradeHost  
from stable import vm_upgarde, disk_upgrade

然后我尝试安装该软件包。

packages=['upgradehost'],
py_modules=['upgradehost.core', 'upgradehost.stable'],  # I added this after getting the "ModuleNotFoundError: No module named 'core'" the first time.

然后,我尝试从\ Python \ Python38-32 \ Scripts目录运行该应用程序。

> python setup.py install

creating build\bdist.win32\egg\upgradehost
copying build\lib\upgradehost\1.py -> build\bdist.win32\egg\upgradehost
copying build\lib\upgradehost\app.py -> build\bdist.win32\egg\upgradehost
copying build\lib\upgradehost\core.py -> build\bdist.win32\egg\upgradehost
copying build\lib\upgradehost\stable.py -> build\bdist.win32\egg\upgradehost
copying build\lib\upgradehost\__init__.py -> build\bdist.win32\egg\upgradehost
.
.
.
byte-compiling build\bdist.win32\egg\upgradehost\app.py to app.cpython-38.pyc
byte-compiling build\bdist.win32\egg\upgradehost\core.py to core.cpython-38.pyc
byte-compiling build\bdist.win32\egg\upgradehost\stable.py to stable.cpython-38.pyc
.
.
.
Installed c:\users\may\appdata\local\programs\python\python38-32\lib\site-packages\upgradehost-0.0.1-py3.8.egg
Processing dependencies for upgradehost==0.0.1
Finished processing dependencies for upgradehost==0.0.1

我需要您的帮助,让我知道这里发生了什么以及如何解决。 我在Windows 10和Python 3.8上

0 个答案:

没有答案
相关问题