Namespace Corrupted When Using Setup.py And Causes AttributeError: Module Has No Attribute
I wrote a small tool (package) that reuses an existing namespace, pki.server. I named my package as pki.server.healthcheck. The old namespace did not use setuptools to install the
Solution 1:
Your __init__.py
files need to import the files. You have two options--absolute and relative imports:
Relative Imports
pki/__init__.py:
from . import server
pki/server/__init__.py:
from . import instance
Absolute Imports
pki/__init__.py:
import pki.server
pki/server/__init__.py:
import pki.server.instance
Post a Comment for "Namespace Corrupted When Using Setup.py And Causes AttributeError: Module Has No Attribute"