简体   繁体   中英

Python packages not building properly

I am trying to create a python package of a directory which looks like this.

在此处输入图像描述

My setup.py looks like this

from setuptools import setup, find_packages
setup(
    name='incr-consumer',
    version='0.0.1',
    description="BBB",
    packages=find_packages(),
    package_data={x: ['*.csv', '*.json', '*.txt', '*.sql', '*.yml', '*.cfg'] for x in find_packages()},
    include_package_data=True,
    install_requires=[line for line in open('requirements.txt')],
    options={"bdist_wheel": {"universal": True}},
    entry_points={
        'console_scripts': [
            'archiver=incr_consumer.src.kkk:main',
            'produce=incr_consumer.util.ppp:main'
        ]
    }
)

I have successfully installed the package via python install -e. When I try to see if the package works I don't see the module available to me.

[Note: I have an __init__.py within src. Please let me know why is this happening, and what can I do to resolve this. 在此处输入图像描述

You'll probably also need to have an __init__.py within incr_consumer to mark it as a package.

If you do print(find_packages()) in your setup script, it's probably not currently enumerating all packages correctly.

You can specify package_dir={'incr_consumer': 'src'} (see also here ) and then specify everything else relative to the src directory (including the console scripts).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM