Closed ghost closed 4 years ago
There are lots of circular imports, which cause these problem. A good discussion about circular imports and its problems is on stackoverflow.com: https://stackoverflow.com/questions/22187279/python-circular-importing
There are multiple dependencies between the modules streamsx.topology.context
, streamsx.rest
, streamsx.rest_primitives
, and streamsx.build
. When a module is imported, all code in it is executed. The role of __init__.py
is not considered here.
When importing streamsx.rest_primitives,
following happens:
from streamsx.rest_primitives import ...
)With circular dependencies no from xyz import nnn
should be done. The better choice would be to avoid circular imports by a clean refactoring.
Importing the whole module
import streamsx.rest_primitives
also raises ImportError.Current workaround: Do
import streamsx.topology.context
before importing anything from rest_primitives.