tqdm: 'module' object is not callable tqdm: 'module' object is not callable python python

tqdm: 'module' object is not callable


The error is telling you are trying to call the module. You can't do this.

To call you just have to do

tqdm.tqdm(dirs, desc='dirs') 

to solve your problem. Or simply change your import to

from tqdm import tqdm

But, the important thing here is to review the documentation for what you are using and ensure you are using it properly.


tqdm is a module (like matplotlib or pandas) that contains functions. One of these functions is called tqdm. Therefore, you have to call tqdm.tqdm to call the function within the module instead of the module itself.


You Have Used Only tqdm, Actually it is tqdm.tqdmSo, Try

from tqdm import tqdmfor dir in tqdm(dirs, desc = 'dirs'):print(dir)