Python3.8 Import Error No module name tqdm found

210 views Asked by At

I'm trying to run this python project on my linux machine. I did setup everything according to the requirement but when I try to run the project with the ./generate.sh executable file I got the following error.

Import Error: No module name tqdm found.

Here are the imports exists in file.

import os.path as path
import ast
from glob import glob
import signal
import imp
import logging
import time
import numpy as np
import socket
import tqdm
import sys
import click
import tensorflow as tf
from tensorflow.python.client import timeline

I check with pip3 show tqdm command it shows me the package detail. I also try to uninstall and install again the project but got no luck.

If i remove the tqdm import from the file then it shows me this error.

  File "./run.py", line 16, in <module>
    import click
ImportError: No module named click

Can someone guide me what I'm doing wrong here?

1

There are 1 answers

1
sleepyhead On

it seems you are importing it wrong, from tqdm docs:

from tqdm import tqdm

I've checked it for both python2 and 3 and this is the way to use it.

The project you are trying to use at least 3 years old, so maybe things have changed since then, so if it wont work for you even with proper import statement you can simply remove it.

Every loop working with tqdm will work without it as well. For example:

from tqdm import tqdm

for i in tqdm(range(10000)):
    pass

is the same as:

for i in range(10000)):
    pass