I need to import 2 variables from a main file into an additional one. These variables are used in the numba function of the additional file, which is called in the main.
main file:
import file2
SIGMA = 10
MEAN = 0
q = file2.compute(img)
additional file:
import numba as nb
from main import SIGMA, MEAN
@nb.njit('uint8[:,:,::1](uint8[:,:,::1])', parallel=True)
def compute(image):
return = function(MEAN,SIGMA)
But the code threw:
File "D:\", line 5, in <module>
from main import SIGMA, MEAN
File "D:\", line 18, in <module>
q = file2.compute(img)
AttributeError: partially initialized module 'file2' has no attribute 'compute' (most likely due to a circular import)