Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

importerror: cannot import name

# While you should definitely avoid circular dependencies,
# you can defer imports in python.
# for example:

import SomeModule

def someFunction(arg):
    from some.dependency import DependentClass
    
#this ( at least in some instances ) will circumvent the error.
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #import
ADD COMMENT
Topic
Name
1+2 =