Python Custom package import module name not importing on init

To illustrate my comment,

my_package.py:

from pygdbmi.gdbcontroller import GdbController

__version__ = '0.0.1'
__title__ = 'my_package'

class my_class:
    def __init__(self):
        print("my_class!!")

setup.py:

# ...

setuptools.setup(
    # Project information
    name=my_package.__title__,
    version=my_package.__version__,
    long_description_content_type="text/markdown",
    py_modules=['my_package'],  # replaces `packages=setuptools.find_packages(),`
    install_requires=["pygdbmi"],
    python_requires='>=3.7',
    # Tests
    test_suite='tests'
)

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top